There are multiple effects at play, and how much each contributes depends on the depth of the water, as well as on the direction you're looking at.
If you are looking straight down into the water, then the dominant effects are light absorption and light scattering. If the water is shallow, most of the light reaches the bottom, and is reflected back, so the water appears transparent - unless it's muddy or murky.
If you go further away from the shore, you'll notice that you can still see the bottom, but that its hue is a bit different: it's blue-greenish, and as you go further and further from the shore, it may appear as if you're looking at it through a bluish haze. This is because the light in red-orange-yellow part of the spectrum mostly doesn't reach the bottom - because water molecules absorb it. The blue part of the spectrum, however, partly reaches the bottom, and is partly scattered around (similar to how it's scattered in the atmosphere). The rays that are reflected off of the bottom and manage to reach your eyes is what lets you actually see the bottom. If there's a lot of scattering, the scattered rays come from random directions and thus don't really carry an image - they just produce the blue haze effect.
As you go even further away from the shore, all light is either absorbed or scattered before it reaches the bottom, and all you see is the ocean blue.
Notice also that large waves sometimes have a blue-green tint (especially near the top), even though the ocean from which they arise appears a deeper blue; this is because the thickness of the wave is not enough to eliminate all of the non-blue light.

See also: Ocean Color article from NASA Science website
But now, change your viewing angle - go from looking straight down, towards looking at the horizon. As you change the angle of your gaze, your eyes "catch" the light rays coming from lower and lower angles with respect to the ocean surface. Well, water partially reflects light, and it reflects more light if the angle of the incoming light ray is low (with respect to the surface). E.g. look at this photo - you can see that the water reflects the sky, including the clouds:
(free stock photo: source)
In the image below, you can see the lake floor through the water near the bottom of the frame, but as you go towards the other shore you generally see more and more of the reflection, until all you can see are the reflected trees. This is somewhat perturbed by the wavy surface - the waves change the angle of incidence, so in the lower left you also get a discontinuous reflection of the mountains and the sky on the parts of the wavy surface that are angled with respect to the observer.
(free stock photo: source)
This is called Fresnel reflection.
See also:
Fresnel Equations
Snell's Window