Electronic transitions involve exciting an electron from one principle quantum state to another. Only by absorbing energy, can an electron be excited. Once it is in the excited state, it will relax back to it's original more energetically stable state, and in the process, release energy as photons. As different elements have different electronic configurations and the different set of quantum numbers, thus the electronic spectrum is characteristic of an element.