My concern is about the constancy of c (the speed of light); as light goes into a denser medium than the medium it was previously travelling in, the light slows down and it bends as a cause of this. This seemed contradicting to me that the speed of light is constant and yet its speed varies in different mediums. Why isn't c constant in all mediums and does this variation of c in different mediums mean in anyway that time flows differently in different mediums?
You are correct that talk of the speed of light can be misleading. When we discuss the constancy of c we mean the speed of light in a vacuum. Since interstellar space is very empty and much like a vacuum, astronomers usually don't have to consider the speed of light in different media.
However, the speed of light is not constant as it moves from medium to medium. When light enters a denser medium (like from air to glass) the speed and wavelength of the light wave decrease while the frequency stays the same. How much light slows down depends on the new medium's index of refraction, n. (The speed of light in a medium with index n is c/n.) The index of refraction is determined by the electric and magnetic properties of the medium. For air, n is 1.0003, for ice, n is 1.31, and for diamond, n is 2.417. The bending of the light you mentioned upon entering a denser medium is how lenses work.
Although the speed of light is no longer constant when we think about different media, we do know that light always travels fastest in a vacuum. Nothing can reach speeds faster than c (well that's not exactly true, see here for more details). Thus from our equation v=c/n, n must always be greater than 1. Light moves slower through denser media because more particles get in its way. Each time the light bumps into a particle of the medium, the light gets absorbed which causes the particle to vibrate a little and then the light gets re-emitted. This process causes a time delay in the light's movement so the more particles there are (the more dense the medium), then the more the light will be slowed down.
This page was last updated June 27, 2015.