We obtain analytic formulae for the null geodesics of Friedmann-Lemait
re-Robertson-Walker spacetimes with scalar perturbations in the longit
udinal gauge. From these we provide a rigorous derivation of the cosmo
logical lens equation and obtain an expression for the magnification o
f a bundle of light rays without restriction to static or thin lens sc
enarios. We show how the usual magnification matrix naturally emerges
in the appropriate limits.