For complete treatement, See [this reference] (http://preposterousuniverse.com/grnotes/grnotes-seven.pdf) page 172 (formula 7.32) and following pages.
The idea is to use an affine parameter $\lambda$, such as :
$$g_{\mu\nu} \frac{dx^{\mu}}{d\lambda} \frac{dx^{\mu}}{d\lambda} = - \epsilon$$
(in a metrics $g = (-1,1,1,1))$
For massive particles, you can choose $\lambda = \tau$, which is the proper time of the particle, so $\epsilon = - 1$
For massless particles, $\lambda$ is different of $\tau$, because $d\tau=0$ , In this case, you have $\epsilon = 0 $.
So you can make all the calculus with this $\epsilon$, for instance, you Will have an effective potential as :
$$V(r) = \frac{1}{2} \epsilon - \epsilon \frac{GM}{R} + \frac{L^2}{2R^2} - \frac{GML^2}{R^3} $$(page 174 formula 7- 48 of the reference)
Page 176 of the reference, you will see the different orbits for massive and massless particles.