  We analyzed the influence of static gravitational field on the vacuum and
proposed the concept of inhomogeneous vacuum. According to the corresponding
Fermat's principle in the general relativity, we derived a graded refractive
index of vacuum in a static gravitational field. We found that the light
deflection in a gravitational field can be calculated correctly with the use of
this refractive index and therefore the gravitational lensing can be treated
conveniently with the optical method. For illustration, we simulated the
imaging of gravitational lensing, figured out the time delay between the two
images and calculated the lens mass in a conventional optical way.
