(D) As shown in the figure,when a light ray passes tangentially to the surface of a central massive body of mass $M$ and radius $R$,suppose it gets deviated by an amount $d\theta$ within a distance $dr$.
Applying Snell's law at the point where the light ray is incident on the concentric spherical surface at distance $r$ from the centre of the central massive body,we get:
$n \sin \theta = (n + dn) \sin(\theta + d\theta)$
$n \sin \theta = (n + dn)(\sin \theta \cos d\theta + \cos \theta \sin d\theta)$
Since $d\theta$ is extremely small,$\sin(d\theta) \approx d\theta$ and $\cos(d\theta) \approx 1$:
$n \sin \theta = n \sin \theta + n \cos \theta (d\theta) + (dn) \sin \theta$
$0 = n \cos \theta (d\theta) + (dn) \sin \theta$
$-(dn) \sin \theta = n \cos \theta (d\theta)$
$-\left(\frac{dn}{dr}\right) \tan \theta = n \left(\frac{d\theta}{dr}\right)$
Given $n = 1 + \frac{2GM}{rc^2}$,we have $\frac{dn}{dr} = -\frac{2GM}{r^2c^2}$.
For a grazing ray,$\theta$ is very small,so $\tan \theta \approx \sin \theta \approx \frac{b}{r}$ where $b \approx R$ is the impact parameter.
Substituting $\frac{dn}{dr}$ and integrating $\int d\theta = \int -\frac{1}{n} \frac{dn}{dr} \tan \theta dr$ along the path,the total deviation $\Delta \theta = \int_{-\infty}^{\infty} \frac{2GM}{r^2c^2} \frac{b}{r} dx = \frac{4GM}{Rc^2}$.