The phenomenon of obtaining a spectrum of colors by passing white light though the prism is known as dispersion
Dispersion occurs because the refraction of different colors travels with different speeds in a refracting medium. Speed of violet colour is least and thai of the red colour is the most. Hence the refractive index of the medium is largest for violet colour and least for the red colour.