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?