"We all take the beautiful blue color of our skies for granted. However, if Earth's atmosphere contained different gases, this would not be the case. Air is made up of a mixture of gases in the following proportions: 78 percent nitrogen, 21 percent oxygen, and 1 percent carbon dioxide and trace amounts of other gases.
The chemical composition of the gases in the air accounts for the color of the sky. The light coming to Earth from the sun contains all wavelengths and therefore all colors. Each color has its own wavelength - some are short, some are long. This is evidenced by rainbows, in which raindrops act as prisms, bending each wavelength of light at slightly different angles and causing the beautifullly colored bands of light.
The longer wavelengths, yellow and red, reach our eyes in a nearly direct line from the sun. The shorter wavelengths, blue and violet, are more scattered by air molecules. This acts to diffuse the blue light, and it reaches our eyes from all parts of the sky, making the sky appear blue."