This is a rare light phenomenon called a 'circumhorizontal arc' which in better terms is a rainbow in the clouds. It occurs when light is refracted and then split into the full spectrum just like that when moisture creates a rainbow after it rains. The slight differentiation in the wavelengths of red to purple light create a different diffration angle for each type of light, thus, the white light seperates into its visible parts: a rainbow.
The clouds though, must be very high in the sky, as the rainbow we see after it rains occurs because the sun is on the opposite side of the sky with respect to the rainbow, to form the correct angle (usually 46 degrees) but these rainbows form, high enough int he sky that the correct angle of refraction can occur before the light passes over our heads., at a 22 degree angle and in rare cases with a hazy sky, the entire halo can be formed aroung the sun. This is similar to the rainbows we see in waterfall mist, although much larger scale and MUCH higher up in the sky.
Similarly, there is a rare occurence in which the moon is bright enough (or a camera has a high exposure setting) where a waterfall can get the mist at the correct angle to make a moonbow. Also, next time that you can see the moon behind a hazy sky, look closely at its 'halo' of light, in the edges, the haze differcta the light into a rainbow-like arc; called a 'corona'.