Rainbow is typically observed soon after a rain shower. It is caused due to dispersion of sunlight by raindrops suspended in air.
Water drops acts like prisms. Rainbow is obtained in the direction opposite to that of the sun.
Water drops, refract the sunlight, disperse, reflect internally and then refract it again. It is due to dispersion of light that the eye sees different colours in a series in the sky. This is rainbow.
This appears curved because of the circular shape of earth, other wise if viewed from aeroplane it will appear circular.