Why is the sky blue?

One wives' tale is that the sky is blue because it reflects the oceans. Not true! The real reason that, from here on Earth, the sky looks blue during the day is because of the way air scatters wavelengths.

The sky is made up of mostly gas molecules but also a few other things (like dust, ice crystals, water). Light travels in waves, and although light may look "white" to a human eye, it's really made up of several shades of reds, greens, and blues. (You can see these colors when you bend light through a prism.) The sunlight that travels into our atmosphere moves in a straight line until it hits something. When light hits a gas molecule, some of it gets absorbed, but eventually the molecule lets go of the light it has captured. The higher frequencies of light's wavelengths (blues) are absorbed more often than the lower frequencies (reds). And thus blue light is released.

That's why the sky is blue.

You'll also notice that when you look at the horizon, the blue sky is paler than it is overhead. That's because the light needs to travel through more air (and thus more gas molecules, dust, ice) to reach you. It thins out.

The sky is red at sunrise and sunset because at this time, most of the light we see from Earth comes in almost tangent to the earth. This makes the light's path through the atmosphere so long that a lot of the blue light is lost, which leaves the reds and oranges.