Refraction, when used in the context of a rainbow, is defined as the bending of light when it passes from one medium to another. In case of a rainbow, there are seven media, represented by the seven colours of the rainbow, namely violet, indigo, blue, green, yellow, orange and red, popularly known by the acronym VIBGYOR.
When the light enters the first medium, namely the portion of the rainbow which is violet in colour, it is due to refraction that the direction of the light wave keeps on fluctuating. These changes take place six more times, and it finally leaves the part of the rainbow which is red in colour in a different direction, which is completely unlike the one in which it had entered the object in the first place. Apart from its direction, refraction also changes the speed of light, and these changes take place as the light passes obliquely from one medium to another.
When the light enters the first medium, namely the portion of the rainbow which is violet in colour, it is due to refraction that the direction of the light wave keeps on fluctuating. These changes take place six more times, and it finally leaves the part of the rainbow which is red in colour in a different direction, which is completely unlike the one in which it had entered the object in the first place. Apart from its direction, refraction also changes the speed of light, and these changes take place as the light passes obliquely from one medium to another.