Here is a relevant piece:
When light enters a material, photons are absorbed by the atoms in that material, increasing the energy of the atom. The atom will then lose energy after some tiny fraction of time, emitting a photon in the process. This photon, which is identical to the first, travels at the speed of light until it is absorbed by another atom and the process repeats. The delay between the time that the atom absorbs the photon and the excited atom releases as photon causes it to appear that light is slowing down.