The other answers are correct, but I think they miss one important point.
The energy levels are not really discrete, because:
Frequencies are not exactly defined. Due to the Heisenberg uncertainty principle, the location and frequency of a photon cannot both be exactly determined. Therefore, emission (and absorption) does not happen at an exact frequency, but at a finite range of frequencies. This is called natural broadening.
Next, molecules do not exist in isolation. They collide with other molecules, which again changes the energy levels. This is called pressure broadening.
Next, molecules are not stationary, but are quickly moving. This also causes the energy levels (absorption/emission lines) to broaden. This is called thermal broadening.
The latter two are much stronger than the first one (at least in the Earth's atmosphere), but the first one is very fundamental as well. Energy levels are not really discrete. Therefore, the electromagnetic spectrum is not, either.