If the energy of an atom is increased, an electron in the atom gets excited. To go back to its ground state, the electron releases energy. The energy of the light released when an electron drops in energy level is the same as the difference in energy between the two levels.