The sky isn’t actually blue at all! The blue comes from the spectrum of light that goes through it. Firstly, let’s explain light – light, like all things in the electromagnetic spectrum is made up of waves. All of the different colours of light have their own wavelength.
With the atmosphere, this is made up of various particles, and as the light hits a particle it is diffracted. The longer wavelengths such as red and orange pass straight through, whereas blue (the shorter wavelength) is diffracted the most. This leaves the sky looking blue during the day (as the blue is diffracted towards you at an angle from light travelling through the sky) and red as the sun is setting (as the light has to travel further and is travelling through a lot of particles straight towards you.
If you shine white light through a prism, you can split it into red, orange, yellow, green, blue, indigo and violet – this is called refraction. The sun shining through rain drops is the same effect and causes a rainbow. When the sun shines directly through our atmosphere in the middle of the day the light refracts so we see the sky as blue. At dawn or dusk, the light travels through more atmosphere, so the sky looks red.
Its all to do with the scattering of light as it moves through the atmosphere. The longer wavelengths pass straight through so little red, orange and yellow light is seen. The shorter wavelength light, which is blue light, is absorbed by gas molecules in the atmosphere and is then radiated in different directions so gets scattered all around the sky. Wherever you look overhead, some of the scattered blue light reaches you and since it’s everywhere, the sky looks blue.
Sunlight is made up of a mixture of different colours of light – you can see these colours split up and displayed in rainbows, or when you allow light to pass through a triangular prism. The light we see in the sky (when we’re not looking directly at the sun) is scattered light – that is, light that bounces off molecules and is sent in a new direction. In the atmosphere, blue light is scattered better (i.e. more of it is scattered), so the light from the sky looks blue. This also explains the colour of sunsets. When the sun is low in the sky, the light has to pass through a great thickness of the atmostphere and so is scattered away from us. What is left, arriving at our eye in an almost a direct line, is the unscattered red light.