Actually sun gives us  no white light but when it rains and at the same time the sun is seen only then sun's light passes through the tiny droplets of water falling and it is said that when white light passes through any transperant object like glass,etc...then it forms VIBGYOR meaning v-violet i-indigo b-blue g-green y-yellow  o-orange r-red nd hence forms rainbow