Rainbows are diffracttion of light though raindrops. this is why you usually seem then on sunnay days mixed with showers.
The sunlight gets broken up so you can see the the visible componts of light, starting with violet, going through to green and then red.
Rain droplets in the atmosphere act like prisms- white light is made up of a spectrum of colours (the rainbow!) and when a ray of white light passes through a prism it splits up so you can see all the colours.