How light is able to choose the path to take? I'm a student at STEM School (10th grade), and I'm studying optics and light in Physics.
I was studying the Fermat principle which say:

The path taken between two points by a ray of light is the path that
  can be traversed in the least time.

I asked myself, how light is supposed to know which path to take, in so less time (3*10^8 m/s), considering light hasn't mass and how their 'atoms and molecol' set to choose the less time?
(Sorry for my english, but english isn't my 1st language)
 A: Light is a wave. The light actually takes all possible paths, but (putting it simply) the wave patterns of most of these paths cancel out. The remaining path after combining all of the possible paths is the shortest one.
Feynman Lectures: Optics: The Principle of Least Time
A: You can explain it using the Huygens principle. basically, exery point the lightwave reaches becomes can be treated as origin of a new spherical wave, and all such waves interere with each other to create a macroscopic path for the light ray. In this way, the light checks all neighboring paths, and chooses the one that is locally preferable. The efect is such that, when you look backwards from the point that the light wave has reached, and try to determine from which direction the ray has come from and what path did it take, you see that it came along the path that allowed it to get to the end in a fastest way. Note that it doesn't have to be global minimum, just local, i.e. there are no paths close to the one chosen that are faster.
A: I don't really have an answer, but here is an analogy.
When you design digital circuits, you can have multiple paths that the electric current can follow. And (to a reasonable approximation) the shortest one is the one that delivers the signal. Cut the shortest one and the next shortest path counts.
By providing multiple paths you can increase the yield of usable chips. If something is wrong with the shortest path, there is a backup with reduced performance.
