How do materials absorb light?

Let us first try to understand why we must get peaks in our spectra. Considered for simplicity, transitions between $3$ energy levels. Now if the energy levels are sharply defined, then we expect to see three peaks in our spectra, not because there are $3$ levels but because there are $3$ unique pairs that can be formed ($^3C_2=3$).enter image description hereThe height of the spectra depends on how strongly the energy levels in question couple with the electromagnetic field.

In gases, the energy levels are usually sharply defined. But still the spectra is not completely discrete. One of the main reasons is Doppler effect. Due to the motion of the atoms, they see a Doppler shifted frequency of the incoming light. This means they absorb light of “wrong” frequency. And since the atoms in general have a velocity distribution, this translates to a distribution in the resonant frequency. This causes a broadening in the spectra(which can be reduced by lowering the temperature). enter image description here

Coming to solids, the energy levels are not sharp to begin with. They are broad in general. Thus there is a continuous range of transition that can be made. enter image description here