The propagation of high-frequency electromagnetic waves can be analyzed using the geometrical optics approximation. In the case of large but finite frequencies, the geometrical optics approximation is no longer accurate, and polarization-dependent corrections at first order in wavelength modify the propagation of light in an inhomogenous medium via a spin-orbit coupling mechanism. This effect, known as the spin Hall effect of light, has been experimentally observed. In this talk I will discuss recent work which generalizes the spin Hall effect to the propagation of light and gravitational waves in inhomogenous spacetimes. This is based on joint work with Marius Oancea and Jeremie Joudioux.