An effective-mass theory of subsurface scanning tunneling microscopy (STM) is developed. Subsurface structures such as quantum dots embedded into a semiconductor slab are considered. States localized around subsurface structures match on to a tail that decays into the vacuum above the surface. It is shown that the lateral variation in this tail may be found from a surface envelope function provided that the effects of the slab surfaces and the subsurface structure decouple approximately. The surface envelope function is given by a weighted integral of a bulk envelope function that satisfies boundary conditions appropriate to the slab. The weight function decays into the slab inversely with distance and this slow decay explains the subsurface sensitivity of STM. These results enable STM images to be computed simply and economically from the bulk envelope function. The method is used to compute wave-function images of cleaved quantum dots and the computed images agree very well with experiment.