When sunlight enters a raindrop it is refracted or bent much like sunlight entering and exiting a prism. The sun faces the rainbow even though there still may be dark clouds and rain the light is refracted in the raindrops. When the sunlight is refracted in the rain drop it reflects the colours of a rainbow. The light is always reflected in the same order of colours from the inside out they are violet, indigo, blue, green, yellow, orange and red on the top of the rainbow.

More Info: en.wikipedia.org