  This work arose as an aftermath of Cassini's 2002 experiment \cite{bblipt03},
in which the PPN parameter $\gamma$ was measured with an accuracy
$\sigma_\gamma = 2.3\times 10^{-5}$ and found consistent with the prediction
$\gamma =1$ of general relativity. The Orbit Determination Program (ODP) of
NASA's Jet Propulsion Laboratory, which was used in the data analysis, is based
on an expression for the gravitational delay which differs from the standard
formula; this difference is of second order in powers of $m$ -- the sun's
gravitational radius -- but in Cassini's case it was much larger than the
expected order of magnitude $m^2/b$, where $b$ is the ray's closest approach
distance. Since the ODP does not account for any other second-order terms, it
is necessary, also in view of future more accurate experiments, to
systematically evaluate higher order corrections and to determine which terms
are significant. Light propagation in a static spacetime is equivalent to a
problem in ordinary geometrical optics; Fermat's action functional at its
minimum is just the light-time between the two end points A and B. A new and
powerful formulation is thus obtained. Asymptotic power series are necessary to
provide a safe and automatic way of selecting which terms to keep at each
order. Higher order approximations to the delay and the deflection are
obtained. We also show that in a close superior conjunction, when $b$ is much
smaller than the distances of A and B from the Sun, of order $R$, say, the
second-order correction has an \emph{enhanced} part of order $m^2R/b^2$, which
corresponds just to the second-order terms introduced in the ODP. Gravitational
deflection of the image of a far away source, observed from a finite distance
from the mass, is obtained to $O(m^2)$.
