A Morse Theory for light rays in Stably Causal Lorentzian manifolds