Filtering and Chemical Effects in the Atmosphere

The atmosphere is not uniformly transparent to all wavelengths of electromagnetic radiation. The various gases absorb specific wavelengths by changing vibrational or rotational modes of molecules, or by breaking bonds that hold molecules together.
 
For example, the oxygen molecule (O2) is held together by a bond that has energy corresponding to high energy ultraviolet (UVC) wavelengths. Because there is so much O2 in the atmosphere (about 20%), virtually all UVC is absorbed by O2 before reaching the ground.
 
As another example, the third oxygen atom of ozone is held onto the other two O atoms more weakly, so this bond is broken when ozone absorbs a lower energy UVB photon. This is the essence of the problem of the stratospheric ozone hole, as UVB can damage cells and DNA of living organisms on the earth's surface.
Some gases absorb much lower energy (longer wavelength) EM radiation. The class of greenhouse gases, for example, absorbs the infrared radiation emitted by the earth's surface thus trapping it in the atmosphere.