Rainbow is a natural spectrum of light appearing after or during the rain shower when. Where the sunlight work as the beam of light which disperse by tiny water droplets present in the atmosphere. A rainbow is always formed in the opposite direction of sun.
The water droplets work as prism, which convert and spread rays of sun into seven colors i.e. VIBGYOR (V-violet, I-indigo, B-blue, G-green, Y-yellow, O-orange, R-red) this is called dispersion of light. These seven colour when are obtained are known as spectrum of light. The prism work as a medium which spread and combine the beam of light.
Issac Newton was first one to use a glass prism to obtain the spectrum of light.
The water droplet work as the prism. from it the ray of sunlight refract and disperse the incident sunlight, then refract internally and finally, refract it again when it comes out of raindrop. Due to the dispersion of light and internal reflection, different colours reach the observer’s eyes.
Yes we can make a artificial rainbow by using a glass prism, a beam of light. We just need to make the beam of light pass through the prism and we can see that, there a spectrum of light. the phenomena occurring in both cases are same so the result will be same. But the size and maybe shape will be different. It is the experiment of spectrum of light and dispersion.