Sunlight includes all color of spectrum. The sky appears blue during the day because air molecules in the atmosphere scatter light from the blue end of spectrum in all directions
If it rains on a sunny day, you may well c a rainbow if u stand with ur back to the Sun. A rainbow is a curved white light spectrum that forms when light is reflected and refracted by raindrop in the sky.
How a rainbow forms:
When white sunlight passes through a raindrop, the raindrop act like a tiny prism. The raindrop refracts the light and splits it up into separate colors. The color fan out and emerge as a spectrum. A rainbow is made up of spectra from millions of raindrops.