If light passes near a massive object, the gravitational interaction causes of bending of the ray. This can be thought of as happening due to a change in the effective refractive index of the medium given by,
                           n(r)=1+2 GM/rc2
where r is the distance of the point of consideration from the centre of the mass of the massive body, G is the universal gravitational constant, M the mass of the body and c the speed of light in the vacuum. Considering a spherical object find the deviation of the ray from the original path as it grazes the object.

Hint: The deviation of light depends on the refractive index of the object.

Step 1: Use Snell's law.

Let us consider two planes at r and r+dr. Let the light be incident at an angle θ at the plane at r and leave r + dr at an angle θ+dθ. Then from Snell's law,

                 

n(r)sinθ= n(r + dr) sin(θ + dθ)
 n(r) sinθ = n(r)+dndrdr(sinθcosdθ+cosθ sindθ) 

As  is small, cosdθ=1 and sindθ=,

n(r) sinθn (r)+dndrdr(sinθ+cosθdθ)

Ignoring the product of differentials;
                                 n(r) sinθ=n(r)sinθ+dndrdr sinθ+n(r) cosθdθ
Or we have,                 -dndrtanθ=n(r)dr
                                 2GMr2c2tanθ=1+2GMrc2dr=dr                       As 2GMrc2<<<1
                                0θ0=2GMrc2-tanθdrr2

Step 2: Integrate both sides.
Now, substitution for integrals, we have,
Now,                                     r2=x2+R2 and tan θ=Rx
                                                2rdr= 2xdx
                                        0θ0=2GMc2-xdx(x2+R2)32
Put                                               x= R tanϕ
                                                  dx=R sec2ϕdϕ
                                             θ0=2GMRc2-π/2π/2Rsec2ϕdϕR3 sec3ϕ
                                                     =2GMRc2-π/2π/2cosϕd ϕ=4 GMRc2
This is the required proof.