When a ray of light travels from one medium to the second medium, it bends. If first medium is rarer and second medium is denser, it bends towards the normal while if first medium is denser and second medium is rarer, it bends away from the normal. This bending is due to refractive index of second medium with respect to first.
The refractive index is related to the speed of light in the two media as below : 1μ2= speed of light in second medium speed of light in first medium
or speed of light in second medium =1μ2 speed of light in first medium
where 1μ2 is refractive index of second medium relative to the first medium.
Hence, we see that on passing through another medium speed of light changes.