When an electron in its ground-state and is excited, it moves up an energy level and remains excited for a couple seconds, however when the electron falls down from the excited state, it falls down to a lower energy level and emits a photon, a discrete amount of energy corresponding to a particular wavelength that depends on the differences between the two energy levels in question