You’ve all seen rainbows on those days where it's raining and the sun's out at the same time. But what about those times when you see a rainbow-like halo around the sun or moon?
It's the same physics, really. The halos (or, sometimes known as "sundogs" around the sun) are usually seen when there are high clouds overhead. Those clouds are made of tiny ice crystals, which will refract the sunlight much like a prism will. And voila! You have a rainbow halo around the sun. It works the same way with moonlight. It's usually a sign that rain is on the way, as high clouds usually precede a storm front.
Sometimes the rainbow isn't in the form of a halo, but just colors a streak of clouds -- the ice crystals in that cloud were at just the correct angle from the sun to produce the prism effect shown here.
I never Heard about the rainbow without rain or in direct sun side. It is rare ..or not possible
How long it last depends on the ice crystals - they may move horizontally in wind, or up or down depending on convection currents. Some haloes can last a couple of hours, I think. Must look this up. Some are very fleeting - a few seconds.
The scientific reason behind it is that after rain a few drops of rain hanged in the surface and when light passes through these tiny drops it works like prism (which convert light in 7 colours) and we see the rainbow. It occurs mostly after the rain if you keep your back towards the sun you can see rainbow in front of you.
Jack Leighton/CPA ICT Section