A deviation in the path of a ray of light can be produced
The bending of light as it passes from one medium to another is called refraction. The angle and wavelength at which the light enters a substance and the density of that substance determine how much the light is refracted. The bending occurs because light travels more slowly in a denser medium.
Hence, by a glass prism as well as a rectangular glass slab