Hamilton-Jacobi theory of null geodesic deviation