Black hole spectroscopy from null geodesics