

In a denser medium,the molecules of medium are very close to each other.
In a rare medium, molecules of medium are seperated by a distance(molecules are not so close to each other).
So, in a denser medium light travels with less speed with compare to rare medium.
(you can understand this, like a vehicle have less speed on a road with more traffic.)
