Lord Rayleigh was the first to deal with scattering of light by air molecules. The scattering of sunlight by the molecules of the gases in Earth’s atmosphere is called Rayleigh scattering.
The basic process in scattering is absorption of light by the molecules followed by its re-radiation in different directions. The strength of scattering depends on the wavelength of the light and also the size of the particle which cause scattering.
The amount of scattering is inversely proportional to the fourth power of the wavelength. This is known as Rayleigh scattering law.
Hence, the shorter wavelengths are scattered much more than the longer wavelengths. The blue appearance of sky is due to scattering of sunlight by the atmosphere. According to Rayleigh’s scattering law, blue light is scattered to a greater extent than red light. This scattered radiation causes the sky to appear blue.
At sunrise and sunset the rays from the sun have to travel a larger part of the atmosphere than at noon. Therefore most of the blue light is scattered away and only the red light which is least scattered reaches the observer. Hence, sun appears reddish at sunrise and sunset.