Why does light slow down when entering a prism but speed up when it exits? Where does it get the energy to increase it's velocity?
The reason you treat the light as if it did slow down is an effect of the wave nature of light. We treat light as a wave, with a wavefront propagating with velocity c in vacuum. The wavefront represents a plane in which all the light waves are in the same phase. Now, when this wavefront hits a material, some of the wavelets will hit atoms and excite electrons to a higher energy state. Effectively, the electrons are 'swallowing' the light photon. Every material does this in a different way. The excited electron soon after releases the stored energy in the form of another photon. The key idea here is what happens to the phase of the wave as it gets absorbed and re-emitted. Depending on the resonant or natural frequency of the atom and the frequency of the incoming wave, the emitted photon will have changed phase when compared to it's unaffected brethren.