A very short answer is that light is composed of many colours (in fact, white light as any Pink Floyd fan will know) can be split via a prism into the full spectrum. Different colours inhabit different parts of the visible spectrum - that is that their frequencies are slightly different. Certain frequencies will be refracted (effectively bent away from hitting your eyes) by passing them through particular materials. For instance, if you hold a piece of red cellophane in front of your eyes, you will see that blues and yellows all but disappear - they become red (or red tinged). The sky is the same - on a clear sunny day, the gasses in the atmosphere refract many of the frequencies of the sun's rays, leaving predominantly blue.