Recovery of discontinuities in a nonhomogeneous medium