The speed of light changes depending on the refractive index of the material through which it is passing. In a vacuum the refractive index (n) is 1, so there is no effect. For air, n is 1.0003, for ice, n is 1.31, and for diamond, n is 2.417. The speed of light = c/n. (Speed of light divided by refractive index). Photons of light slow down due to the density of the material because they interact with the molecules of the material by being absorbed and then re-emitted. After the photons of light pass throught the high-index of refraction material, they do not have to interact as much, so they resume their normal speed.
The question implies an assumption that light "slows down" because of "drag", which for ordinary objects implies disspation of energy; in that context it is natural to wonder where the energy comes from to "speed up again". So, in the context of its assumptions, the question is very perceptive, but the assumptions are wrong. Wave propagation always involves some form of inertia (something analogous to mass for ordinary objects, a measure of the wave's tendency to stay at rest until forced into motion, or to stay in motion once moving) and some form of "force" (analogous to what sets ordinary objects in motion). For light, these roles are hard to define simply; but the wave propagating in a medium with polarizable charges and currents has to "move more stuff" as it passes, which effectively increases the inertial factor. Like heavier masses on a chain of springs, this slows down the propagation rate without losing any energy, and is therefore reversible when the wave comes back out into (ahhhh...) free space. It is also important to realize that light is a transverse wave, like the waves in a guitar string. But if you want a complete understanding of these mysteries, I'm afraid you'll need to do a lot of reading and take a couple of Electronics & Magnetism courses.