Within the troposphere water vapour, ozone and other gases absorb much of the near infrared radiation. Very small- suspended particles in the troposphere scatter visible spectrum both to the space and towards the earth surface.
This process adds colour to the sky. The red colour of the rising and the setting sun and the blue colour of the sky are the result of scattering light of the atmosphere.