A question on Quora asks about speed of photons in a refractive medium.
Most of the answers given so far are correct – even when they contradict one another. This is because the path of a photon is something that is not well defined. In quantum theories particles with definite properties don’t really exist between observations, and what we call the path is just something that we infer after observations have been completed and depends on how closely we look. If we set up an experiment to detect single photons after passing from a source through a uniform medium like glass or air, then we find that no photons arrive when the straight line path is obstructed (so they appear to have followed a straight line) and the time delay between emission and detection corresponds to a speed slightly less than that of light in a vacuum. But on the other hand it seems that experiments designed to estimate the speed of photons between adjacent atoms show them travelling at the same speed as they would in a vacuum. One way of explaining this discrepancy is to realize that what quantum theory predicts is that the probability of detecting a photon is the squared magnitude of a sum (actually a generalized integral) of many complex-valued contributions corresponding to paths that a point particle could be imagined to have taken by going either directly in a straight line or by going on a (longer) polygonal path bouncing off electrons and protons in the medium. If there are many charged particles between source and detector the contributions from all these paths may interfere with one another in such a way that they cancel out almost completely everywhere except near events on the straight line path but at times slightly later than for direct travel in a vacuum.