Do you know how a rainbow forms? Well, it is not that complicated to understand once you know a lot about light and reflection. Rainbows form because the object looks to be a certain color because it is only reflecting that wavelength of light, all the other wavelengths are being absorbed. Therefore, the light is reflecting from the ocean. That is why most rainbows are over oceans. It is reflected off the sun, which is why we are able to see the many colors of the rainbow.
It is the colors that we see because the all the wavelengths are the same. In other words, they are made when light is refracted through millions of droplets in the air. White light is made up of red, orange, yellow, green, blue and violet light, so when it is split into components, it is seen as a rainbow.