I have always been fascinated with the ability of solar system objects, the Sun and planets mostly, to function as large telescope lenses. However, I have been unable to find much information about this technology, including the math behind it until now.
There is one serious limitation to this plan; the telescope must have a large focal length. The distance between the gravitational lens and the camera (probably in the form of a very sensitive space telescope) must be at least 550 AU for the Sun, and about 1000 AU for optical use of the Sun. This is by far the best option. For planets, one must be many thousands of AU out. These distances are very great indeed. Voyager 1 is "only" about 116 AU away from the Sun, and unlikely to reach 550 AU in my lifetime. (It has been on the road since 1977, 5 years before my birth.) The technology is on hand to reach 1000 AU. Ion propulsion, solar photon sails, and beamed energy sails are a few possible ways to make this work. But despite the challenge, there is much science to be done here. A telescope using the Sun as a lens would be able to directly image the surfaces of extra-solar planets including probably continents and oceans. It could also allow us to transmit and receive radio signals across the entire galaxy with unprecedented power.
Below is an image that shows the distance needed to use different bodies in the solar system as a lens:
I frequently plug the TAU and FOCAL missions when talking to astronomers and anyone else who may be interested. It is dangerous to underestimate the potential of such a system, even just for radio astronomy alone (in some ways simpler than optical astronomy with gravitational lensing in the light-day to light-month range.)