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} \mu_{2}=\frac{\text { speed of light in first medium }}{\text { speed of light in second medium }}$
or speed of light in second medium
$=\frac{\text { speed of light in first medium }}{{ }_{1} \mu_{2}}$
where ${ }_{1} \mu_{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.