Wavelengths of light are emitted when an electron is coming from an energized state back to its initial state. The energy that is omitted comes in the form of the wavelength. I'm not completely sure if this is totally the way to say it, but it is what I remember from chem last year.