How sun makes sky blue?
When light is sent through a prism, the light is scattered – causing a rainbow. Our atmosphere is just like a prism. The blue color of the sky is due to Rayleigh scattering. As light moves through the atmosphere, most of the longer wavelengths pass straight through. Little of the red, orange and yellow light is affected by the air. However, much of the shorter wavelength light is absorbed by the gas molecules. The absorbed blue light is then radiated in different directions. It gets scattered all around the sky. Whichever direction you look, some of this scattered blue light reaches you. Since you see the blue light from everywhere overhead, the sky looks blue. But as the sun goes down, it takes longer for the light waves to travel, therefore it can cause the red/pink colors at night and in the morning. The sky is black at night merely because there is no sun – its dark outside.