The conventional distorted-wave theory for x-ray scattering from surfaces is expanded to account for phasesensitive reference-beam diffraction in bulk crystals. The expanded theory, presented here for the transmission geometry that is suitable for biological specimens, provides a simple intensity formula with an explicit dependence on the phases of the structure factors. Numerical results show excellent agreement with full dynamical calculations. Based on this theory, a universal optimal condition is proposed for maximizing the referencebeam interference effects in an experiment.