Does a photon need to have EXACTLY the right energy to be absorbed by a gas molecule?
The Physics SE answer (or the part quoted) was incorrect. The photon does not have to have &quot;precisely&quot; the right energy to cause a transition. The reality is that there is a non-zero probability of causing a transition at all photon energies, but the probability distribution is sharply peaked at the energy we calculate to be the energy difference between the two energy eigenstates of the absorbing atom/molecule.
There are a number of effects that cause this broadening of the frequency response of a bunch of atoms/molecules to photon energy.
The transitions have a &quot;natural width&quot; because the transitions take a finite amount of time. This is encapsulated in a form of the famous uncertainty principle, which means that when viewed over a short time period, there is a fuzziness to energy levels in the atom/molecule. A classical analogy is to try and define the frequency of a damped harmonic oscillator. The larger the damping, the quicker the oscillation dies away and the broader is the continuous frequency spectrum.
Related to this is collisional broadening. Transitions can be interrupted/truncated by collisions, again resulting in a broadened frequency response.
A photon of fixed frequency (note that having a group of photons at fixed frequency is equally impossible, for similar reasons at the emitting end) will encounter atoms/molecules travelling with different velocities and as a result their frequency responses will be Doppler shifted by the appropriate amount.
The application of electromagnetic fields can also broaden and shift the frequency response.