When light moves through the atmosphere it passes from gas molecules in the air. Longer wavelength of light passes straight through atmosphere for e.g.: – green, violet, yellow, etc and light of shorter wavelength is absorbed by these molecules for e.g.:- blue light. By the phenomenon called ray Leigh scattering when light passes through the molecules whose diameter is one tenth of wavelength of light, scatters the light in all directions. So the blue light which has got absorbed by the gas molecules are radiated in all directions by the atoms present in the air because of which we see the blue color of sky.
Now here the question arises that violet has shorter wavelength then why not sky appears violet as it can be scattered more effectively by atmosphere. This is because human eye is very sensitive to red, green, and blue color. There are three types of receptor in our eyes:- blue receptors give response to the broad range high frequencies, green to medium frequencies and red to the low frequencies. Perceived color varies with the strength of signals from the receptors.
If the sunâ€™s light not has to pass through atmosphere then the light from the sun had travelled in a straight line and must have appeared as extreme bright star but because blue light is scattered by oxygen in atmosphere the sky appears blue.
Sky appears pale colored when we look at the horizon because the scattered blue light has to pass through more air to reach our eyes and is further reflected in many directions. So less blue light reaches to our eyes.
Many times in the evening sky appears red or orange because of pollution. The dust particles in air filter the rays coming from sun when it is lowered it has to travel much thick layer of atmosphere.
Pictures taken from Mars shows that sky doesnâ€™t appear blue from there because Mars has thin atmospheric layer and light has to pass through dust particle instead of oxygen.