how light "speeds back up" after leaving a substance
As to how light "speeds back up" after leaving a substance, here is the easiest way of looking at it.
Photons always travel at c. When they enter a transparent substance, however, they encounter molecules/atoms. As they do so, the molecules absorb the photons. When that happens the photons cease to exist.
Then after a short delay, the molecule , re-emits a photon traveling in nearly the same direction as the first. This new photon, upon creation, begins to travel at c until it encounters another molecule.
These slight delays between absorption and emission, increases the time it take from the time a photon enters a substance to the time one emerges form the other side.
This give the impression that light slowed down while traveling through the subtance.
(If you knew that some friends had left their home, which was 60 miles distant from you, at a given time, and they arived at your house 1 1/2 hrs later, It would seem to you that they drove the distancea 40 mph. Even if, while on the road, they drove at 60 mph, but stopped for gas along the way, got a quick bite to eat somewhere, had to fix a flat , etc. )
Light travels though a substance in similar fits and starts.
As to why a substance heats while light travels through it, that is simply because there is no such thing as a perfectly transparent material. Not all the photons are re-emitted after being absorbed.
And that's just for the frequencies that the substance is normally transparent to, there are many frequencies for which the substance isn't transparent.
These absorbed photons are what contribute to the heating of the substance.
__________________
Janus
The whole problem with the world is that fools and fanatics are always so certain of themselves, and wiser people so full of doubts.--Bertrand Russell
.
A little learning is a dangerous thing;
Drink deep, or taste not the Pierian spring;
There shallow draughts intoxicate the brain,
And drinking largely sobers us again. -- Alexander Pope