In an atom, the electrons orbit the nucleus with a given set of energy levels. One way to measure these energies is to send light with a known energy through an atomic gas. If the energy of the light matches an energy available to the electron, the atom will absorb the light. By measuring how much light of a given energy is absorbed and how much is transmitted, we can find the energy levels.
A complication to this method arises when we consider the fact that the atoms in the gas are moving. Because of the Doppler effect, atoms moving toward the laser will see it as having a higher energy. This means that some atoms are absorbing the light, even if we think the light has too little energy. Saturated absorption spectroscopy is a method to counteract the Doppler effect, and involves splitting the light into two counter-propagating beams.