How do electrons ever receive the amount of energy needed to move up energy levels?

Suppose there is a (blackbody) electromagnetic radiation source. It should emit a finite amount of photons every second with an intensity against frequency graph looking similar to a Maxwell Boltzmann distribution curve. Every photon has a specific amount of energy. Now, the source is opposite a collection of atoms of an element, for instance neon. Some of the photons have the precise amount of energy required to excite an electron and so move it up an energy level. I have been taught that the energy needed to move it up this level is exact or discrete, any more or less and the electron would not move up to the level.

Frequency - or energy - of a photon can take on any value and thus is a continuous variable. Therefore in the distribution of frequencies/energies for the photons from the source described, surely the probability that any electron has the exact amount of energy required to move an electron up an energy level falls to 0. Despite this, clearly what I have suggested is not the case because electrons clearly absorb the exact amount of energy needed to move them up energy levels all the time as evident from absorption spectra.

My question is therefore, how is it we see all this absorption if the probability that a photon has a precise energy on a continuous scale is 0? Is there some lee-way on how much energy would move an electron up an energy level?

• Well, actual the transitions all have linewidths, so there is some leeway. – Jon Custer May 15 at 16:47

• $+1$, and I would add that even a isolated single-electron hydrogen atom has nonzero emission/absorption linewidths. It doesn't when you compute its energy levels using a model that neglects the quantum EM field, but when the quantum EM field is included (which is a prerequisite for emitting radiation anyway), the linewidths are nonzero. This is called the "natural width" on page 73 in Cohen-Tannoudji et al (1992), Atom-Photon Interactions – Chiral Anomaly May 16 at 1:57