Note that the speed of light referred to is the observed or measured speed in some medium and not the true speed of light (as observed in vacuum). On the microscopic scale, considering electromagnetic radiation to be like a particle, refraction is caused by continual absorption and re-emission (not necessarily in quite the same direction) of the photons that compose the light by the atoms or molecules through which it is passing. In some sense, the light itself travels only through the vacuum existing between these atoms, and is impeded by the atoms. The process of absorption and re-emission itself takes time thereby creating the impression that the light itself has undergone delay (i.e. loss of speed) between entry and exit from the medium in question. It may be noted, that once the light has emerged from the medium it changes back to its original speed and this is without gaining any energy. This can mean only one thing - that the light's speed itself was never altered in the first place. Alternatively, considering electromagnetic radiation to be like a wave, the charges of each atom (primarily the electrons) interfere with the electric and magnetic fields of the radiation, slowing its progress.