The goal of this lecture is to explain to the general mathematical audience the connection that was discovered in the last 20 or so years between the Aubry-Mather theory of Lagrangian systems, due independently to Aubry and Mather in low dimension, and to Mather in higher dimension, and the theory of viscosity solutions of the Hamilton-Jacobi equation, due to Crandall and Lions, and more precis...