We know that sky color is due primarily to Rayleigh scattering.
Is Rayleigh scattering the dominant effect for ocean color too?
[Physics] Is ocean color affected by Rayleigh Scattering
scatteringvisible-light
Related Solutions
Raleigh scattering is very weak so the vast majority of the light from the Sun passes through the atmosphere without being scattered. That means when we look at the Sun we see the 99% of the light that isn't scattered, and that light has the original 5,700K colour spectrum.
The only light we see directly from the Sun is the light that travels in a straight line from the Sun to our eye - that's the horizontal yellow line in this diagram. If you consider the upper yellow line we can't see this light ray because it misses our eye. However the Rayleigh scattering due to the air scatters in all directions, so some of this scattered light reaches our eye. That means when we look away from the Sun we only see the scattered light and not the direct sunlight.
The Rayleigh scattering depends on the wavelength and blue light is scattered most. That means the light we see coming from directions away from the Sun has a spectrum weighted towards the blue. NB it isn't pure blue light. It's a spectrum of light enriched in blue compared to the direct sunlight. A spectrum of the scattered light from the blue sky is given in this answer:
And that's why the Sun looks yellow and the sky looks blue.
Wikipedia states very strongly that explanations of this in terms of Rayleigh scattering are wrong, and that the real explanation is the absorption of blue light by ozone.
Ozone doesn't absorb blue light (much): on the contrary, it absorbs red light much more, thus making the sky look blue. See in particular my answer for the question at Chemistry.SE: What exact color does ozone gas have?. Here's spectral cross section of ozone absorption in the visible(+NIR) range — the Chappuis band:
To the comment:
Could you explain why the effect of ozone is more important after sunset? Why doesn't this change the story during sunset, or during the day?
During the day sunlight passes much smaller distances through the atmosphere, thus is absorbed less. For the same reason it's reddened less by Rayleigh scattering, leaving more blue light to make the sky blue. Thus ozone has much smaller effect on daytime sky.
During sunset much of the sunlight passes through the troposphere, getting redder, while getting scattered into the observer more than from the stratosphere where most of the ozone layer is located (due to higher concentration of air molecules). So the ozone absorption effect is also less pronounced.
And at twilight the Earth's shadow prevents light from passing through troposphere, making the only light visible scattered from the stratosphere and above, and this light in large part gets there through the ozone layer, traversing it through the long dimension.
I have actually tested this ozone explanation of blue hour, using the Precomputed Atmospheric Scattering code to render two versions of the same scene: one for atmosphere with an ozone layer and another without any ozone. Here are the renderings of the Belt of Venus (ignore the white sphere in the center, it's just an irrelevant part of the demo scene):
With ozone layer (the normal Earth atmosphere):
Without any ozone:
Best Answer
Rayleigh scattering is also present in water, but the main reason of the blue color of the sea is absortion, due to vibrational transitions.
See: http://www.dartmouth.edu/~etrnsfer/water.htm