**Photons in media**
In a material, photons couple to the excitations of the medium and behave differently. These excitations can often be described as quasi-particles (such as phonons and excitons); that is, as quantized wave- or particle-like entities propagating though the matter. "Coupling" means here that photons can transform into these excitations (that is, the photon gets absorbed and medium excited, involving the creation of a quasi-particle) and vice versa (the quasi-particle transforms back into a photon, or the medium relaxes by re-emitting the energy as a photon). However, as these transformations are only possibilities, they are not bound to happen and what actually propagates through the medium is a polariton; that is, a quantum-mechanical superposition of the energy quantum being a photon and of it being one of the quasi-particle matter excitations.

According to the rules of quantum mechanics, a measurement (here: just observing what happens to the polariton) breaks this superposition; that is, the quantum either gets absorbed in the medium and stays there (likely to happen in opaque media) or it re-emerges as photon from the surface into space (likely to happen in transparent media).

Matter excitations have a non-linear dispersion relation; that is, their momentum is not proportional to their energy. Hence, these particles propagate slower than the vacuum speed of light. (The propagation speed is the derivative of the dispersion relation with respect to momentum.) This is the formal reason why light is slower in media (such as glass) than in vacuum. (The reason for diffraction can be deduced from this by Huygens' principle.) Another way of phrasing it is to say that the photon, by being blended with the matter excitation to form a polariton, acquires an effective mass, which means that it cannot travel at c, the speed of light in a vacuum.