Emission spectra
A diffraction grating and a spectrometer can be used to look at the emission spectrum from a light source.
If all possible wavelengths of light are present it would look like a continuous spectrum of colours.

However hot gases emit only particular characteristic colours of light.

Each line in the emission spectrum corresponds to an electron moving from a higher energy level to a lower energy level. To do this it emits photon of light the energy of the photon of light is equal to the difference in the energy of the two energy levels.
- h = the Plank constant 6.63 x 10-34 J s
- f = the frequency of the photon in hertz (Hz)
- hf = the energy of the photon in joules (J)
- E1 is the energy of energy level 1 in joules (J)
- E2 is the energy of energy level 2 in joules (J)

Absorption spectra
When white light passes through a gas the gas absorbs particular wavelengths of light. This effect can be seen in light from the sun which initially seems like a conscious spectrum but an closer inspection it can be seen to contain dark lines.