Have you ever looked at the sky and wondered why it is blue?
Contrary to popular belief, the sky is not blue because the ocean is blue. As a matter of fact, the ocean is blue because of the sky. The reason for blue skies is this: white light travels from the sun to earth. If you didn't know, white light is really just the combination of all the different visible wavelengths of light. When this white light hits Earth's atmosphere, certain wavelengths of light are blocked by the different layers of the atmosphere, like certain UV light is blocked by the ozone. All of the visible light, though, makes it straight through. Except for blue light.
Blue light has the smallest wavelength in the visible spectrum (let's say violet, which has an even smaller wavelength, counts as blue), which means it has a higher frequency than other light. It just so happens that when blue light hits the gasses in our atmosphere, it has enough energy to be absorbed by the atoms that make up those different gasses. (Electromagnetic waves with shorter wavelengths have more energy than ones with longer wavelengths.) The atoms that absorb the light then have a higher energy level, so they end up reemitting the blue light so they can get rid of the energy. This emission and reemission causes the blue light to scatter. When the blue light scatters, it seperates from the white light . The atmosphere acts as a prism to it.
But wait. What about sunsets? When the sun appears low on the horizon, the light must pass through more atmosphere to reach your eyes. The atmosphere is thin, so if the sun is directly over your head, the light doesn't have to go far to reach you. But If it is on the horizon, the light must travel through more of the atmosphere to reach your eyes. The atmosphere has aerosols in it (like dust). These aerosols are large, and scatter little bits of light. As the light travels through more of this dust, the effect is greater. The dust scatters small wavelengths of light easier than large wavelengths. Large wavelengths of light, such as red light, pass through this dust with relative ease, so the majority of light that you see is red/orange.