The ocean is blue because the water in the ocean acts as a massive light filter. When the light from the sun hits the water, the ocean water absorbs red light, leaving the blue and green colors of the spectrum behind for humans to view.
Since the ocean acts as a massive light filter, it can also take on green or red hues. This occurs when there is sediment in the ocean, and the sediments absorb different wavelengths of light. However, the majority of the ocean's surface typically appears blue. Underneath the surface, most of the ocean is completely dark because light does not penetrate deeper than 656 feet.