You will notice that the energy is proportional to the square of the integer given by the set of natural numbers. This means the energies are discrete, or quantized. When a measurement is taken, the system will always be found in one or the other of these energy states, and as such, it takes a precise amount of energy to make the electron transition from one state to another.
The energy that will cause the transition comes from the absorption of energy from some other system such as a quantum of incident light. Light gets absorbed as individual quanta as we learned from the photoelectric effect, and they have energies given by E=hf. So to raise the energy level of the electron in our present system from E
1 to E
2, where
, we need a photon that provides that amount of energy. Thus we can equate
. This allows us to find the possible frequencies of light that this system would absorb. By using
for the light, we can find the corresponding wavelengths of light that this system would absorb. The set of all of these absorbed frequencies (or wavelengths) is called the system's
absorption spectrum.
Correspondingly, when the electron goes down to a lower energy state, it will emit light according to the same relations. The set of emitted frequencies is the
emission spectrum.
While these are related (obviously), upon measurement they aren't always equal. The reason for this is that you have to have excited states present in order for them to emit light. To excite electrons into high states might take a tremendous amount of energy in the form of a very high temperature - one which the system for natural reasons may never reach. For this reason, the absorption spectrum will always tend to be more complete than the corresponding material's emission spectrum, which invariably will be missing some transition lines.
In the case of a gas of molecules you could imagine the following: Shine broad spectrum light on the system (may be outside the visible spectrum). Look at what gets transmitted through the gas. You will find that the absorption spectrum gets subtracted out of the continuous spectrum such that there are missing or dimmed frequencies.
The emission spectrum assumes that the gas IS the source of light. But at ambient temperatures nearly every electron is in its lowest energy state and no transitions are taking place. To help the matter, we could heat the gas. It turns out the temperature needs to be very, very high in order to even make an appreciable fraction of the electrons occupy the first excited state. This probability can be approximated using Boltzmann statistics as
,
where the numerator of the exponent contains the energy necessary to excite the state above the ground state and the denominator contains the system's temperature in kelvin and a constant called Boltzmann's constant where
. It is convenient to write Boltzmann's constant in terms of electron-volts for atomic problems. In these units it is
.
What this probability tells us, for instance, is that if the first excited state is 2 eV above the ground state for some gas phase atoms, that even at a temperature of 1200 K, only roughly 4 parts per billion will be in the first excited state, and the rest in the ground state! This is why we never see the emission spectrum of the atmosphere unless lightning lends a whole lot of energy to excite and ionize the atoms and molecules.