This paper applies a new cosmological theory of inertia, called quantised inertia (QI) to the dynamics of light in gravitational fields. It is shown for the first time that QI correctly predicts the observed bending of light by the Sun and the Shapiro time delay. It is also argued that QI provides a simpler and more testable mechanism than standard general relativity since Unruh radiation can be, and has been, directly observed, but a metric of space cannot.