Final answer:
Fermat used the principle of least time, also known as Fermat's principle, to explain the law of refraction. Light takes the path that requires the least amount of time to travel between two points, resulting in the bending of the light ray.
Step-by-step explanation:
Fermat used the principle of least time, also known as Fermat's principle, to explain the law of refraction. According to this principle, light takes the path that requires the least amount of time to travel between two points. When light passes from one medium to another, it changes direction to minimize the time taken, resulting in the bending of the light ray. This principle can be derived mathematically using Huygen's principle and the concept of wavefronts.