Violet light is refracted the most by a prism. When white light passes through a glass prism, violet colour has the minimum speed and a short wavelength. As violet has a short wavelength, it undergoes the maximum deviation and hence appears at the bottom of the spectrum. On the other hand, red light, which is also a part of the spectrum, has the maximum speed and a longer wavelength, and hence it is the least deviated and forms the upper part of the spectrum.