This diagram shows the spectra of the main molecules that participate in the greenhouse effect and the emission spectra of the Sun and the Earth

The red area of the Sun's spectrum is absorbed by the atmosphere and the Earth's surface. The warmed surface emits infrared radiation as indicated by the white areas on the individual molecule's  spectrum. The grey bits are the parts of the spectra that are absorbed by the atmosphere. The blue area on the Earth's emission spectrum is known as the infrared window through which most of the Earth's radiation passes to space unhindered by being absorbed by any of the greenhouse gases.

The last row of the spectra shows the extent of what is known as Rayleigh scattering. This is what happens to high energy quanta and applies to the UV/blue end of the solar radiation coming into the atmosphere. It is this scattering of 'blue' photons by the molecules of the atmosphere which causes the clear sky to be blue. To be precise about this, the sky should really be violet as 'violet' photons are scattered even more than blue ones. Because the human eye is very much less sensitive to violet light than it is to blue light we percieve the sky to be blue.