An electrical discharge is passed through atomic hydrogen.An electron in a lower energy level will about an exact amount of energy that is EQUAL to the energy difference between two energy levels.This electron is promoted to a higher energy level.In the higher energy level, the electron is unstable so will fall back into the lower energy level. As the electron falls, it releases energy as an exact frequency of light.This is why we see lines of exact frequency.