"The ocean looks blue because red, orange and yellow (long wavelength light) are absorbed more strongly by water than is blue (short wavelength light). So when white light from the sun enters the ocean, it is mostly the blue that gets returned. Same reason the sky is blue."
In other words, the color of the ocean and the color of the sky are related but occur independently of each other: in both cases, the preferential absorption of long-wavelength (reddish) light gives rise to the blue. Note that this effect only works if the water is very pure; if the water is full of mud, algae or other impurities, the light scattered off these impurities will overwhelm the water's natural blueness.
Gross then asks, "So why are sunsets orange?" Several people to wrote in to correct or clarify that comment.
Perhaps the most helpful response came from Michael Kruger of the department of physics at the University of Missouri. He sent the following reaction:
"The answer to why the sky is blue isn't quite correct. The sky is blue not because the atmosphere absorbs the other colors, but because the atmosphere tends to scatter shorter wavelength (blue) light to a greater extent than longer wavelength (red) light. Blue light from the sun is scattered every which way, much more so than the other colors, so when you look up at the daytime sky you see blue no matter where you look. This scattering is called 'Rayleigh scattering'; the amount of scattering goes as the frequency of the light to the 4th power. By the way, this effect is most prevalent when the particles that do the scattering are smaller than the wavelength of light, as is the case for the nitrogen and oxygen molecules in the atmosphere.
"Now we are in a position to figure out why sunsets are reddish! When the sun is setting, the light that reaches you has had to go through lots more atmosphere than when the sun is overhead, hence the only color light that is not scattered away is the long wavelength light, the red.
"We can also answer why clouds, milk, powdered sugar and salt are white. The particles in these materials that are responsible for scattering the light are larger than the wavelength of light. Consequently, all colors of light are scattered by more or less the same amount. Much of the scattering in milk is due to the lipids (fat). If you take out the fat, the milk will not scatter as much light; that is probably why skim milk looks the way it does.