Absorption and emission

When atoms absorb energy, through heating, from electricity, or by absorbing electromagnetic radiation, the electrons at a particular level can be pushed up to higher levels (at bigger distances from the nucleus). In time, they jump back down to a lower level radiating energy in the form of electromagnetic waves.

Two images, one with an electron jumping an energy level as it absorbs radiation, the second image has an electron falling between energy levels as it emits radiation.

The frequency of the radiation depends on the size of the jump that the electron makes. Sodium has energy levels that cause the electrons to emit yellow light as they drop from one to the other. The energy levels in mercury are further apart and electrons emit ultraviolet radiation when they jump back down.

A diagram showing the different colours emitted as the energy from an electron is absorbed

In the diagram, the colours of the 'down arrows' represent the colour of the light emitted as the electron makes that drop.