Gravitational lensing beyond geometric optics: I. Formalism and observables