The energy emitted is equal to the difference in energy levels between the two states. When light from a heated gas is analysed using a spectrometer the different wavelengths are clearly visible as a set of distinct lines. This is the emission spectrum of that gas. This is a result of the differences in the atomic structure of each element. This is of immense importance in studying spectra from distant star.
All stars emit a continuous spectrum of all wavelengths through the electromagnetic spectrum.
The relative intensity of these wavelengths is given by the black body distribution. Gases in the surrounding 'atmosphere' absorb amounts of electromagnetic energy which correspond to the differences between energy levels for the electrons . As electrons return to the lower state the wavelengths are emitted in all directions. Therefore very little of the original electromagnetic energy at these wavelengths actually reaches the observer. The continuous spectrum of a star appears to be missing these wavelengths .