Astronomical observations of distant quasars may be important to test models for quantum gravity, which posit Planck-scale spatial uncertainties (spacetime foam) that would produce phase fluctuations in the wavefront of radiation emitted by a source, which may accumulate over large path lengths. We show explicitly how wavefront distortions cause the image intensity to decay to the point where distant objects become undetectable if the accumulated path-length fluctuations become comparable to the wavelength of the radiation. We also reassess previous efforts in this area. We use X-ray and gamma-ray observations to rule out several models of spacetime foam, including the interesting random-walk and holographic models.