Formalism for testing theories of gravity using lensing by compact objects: Static, spherically symmetric case | Synapse