A Morse Theory for light rays on stably causal Lorentzian manifolds