We know from Fermat's principle of least time that light follows the fastest path. But how does light know which path is the fastest?
A way to understand this, is to imagine that light actually follows all paths. However, most paths experience destructive interference with other paths. The only paths that do not experience destructive interference are those in the neighbourhood of paths with stationary (e.g., minimal) action (time).
I strongly recommend reading Feynman's QED: The Strange Theory of Light and Matter. In the link you'll also find a link to video.
The Fermat principle does not say light ray follows the fastest path, it says when there is a light ray, the optical path (length divided by index of refraction) is stationary with respect to small variations in the shape of the ray that preserve the position of the boundary points.
It is not as if light got everywhere the fastest way possible; it goes where directed by the source and surrounding medium. The effect of the medium is such that the resulting path obeys the criterion of stationarity with respect to small variations. In some cases, the optical path is the shortest for the pair of boundary points, in other cases (less common) it is the longest and there may be cases where it is neither (like when stationary point is a saddle point).
protected by Qmechanic♦ Dec 29 '16 at 18:55
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?