When a ray of light enters from a rarer medium into a denser medium,
the refractive index is given by the formula (mu) = sin i / sin r.
Therefore, sin i = (mu) sin r.
(mu) is greater than one.
If r = 0, sinr= 0, Hence sin i = 0. That means angle of incidence is zero.
The ray is incident normally and hence it goes undeviated.
When a ray of light enters from a rarer medium into a denser medium,
in the above formula r is the angle of incidence and i is the angle of refraction.
Again when i = 0, r =0.
Even if the ray enters from a denser medium normally it comes out with out any deviation.