There is a really nice paper on how they fixed the Hubble Space Telescope. They shifted the CCD by small amounts and captured several different images of the point spread function (which was quite bad at the time). Then they propagated their measurement back into the plane of the mirror and were able to determine the phase error and locate the original manufacturing problem.
This enabled to fix the telescope by installing a correction mirror.
Complicated paper: http://www.optics.rochester.edu/workgroups/fienup/PUBLICATIONS/AO93_PRComplicated.pdf
Some nice animation on the work they do for the new telescope: http://www.optics.rochester.edu/workgroups/fienup/Tom/tom_research.html