When atoms are given energy, the electrons in the atoms absorb this energy and the electrons then move to a higher energy state. They later return back down to their ground state. When they do this, light is released. When this light is measured in a spectrometer, the band produced is the atomic emission spectra of the element.$^{11}$
An electron moves in a stationary orbit. This is because, as long as the electron revolves in the same orbit, its energy remains constant. Thus the electron is in a stationary orbit.
When the electron changes its orbit, there is a change in energy. When the electron goes from a lower to higher orbit, it absorbs energy. Higher to lower, it releases energy.
This release and absorption of energy(difference in energy levels) gives rise to different spectrum lines.
$$ \Delta E = E_2 - E_1 $$
$E_2$ is the energy of the electrons final orbit. $E_1$ is the energy of the electrons in the initial orbit. $\Delta E$ is always positive.
The energy of an electron in a stationary orbit(in electron volts, not in portion):
$$ E = \frac{13.6}{n^2} $$