We derive and apply a new integral formula for a closed Riemannian manifold equipped with a pair of complementary orthogonal distributions (plane fields). The integrand depends on the second fundamental forms and integrability tensors of the distributions, their covariant derivatives, and of the Ricci curvature of the ambient manifold. Also, we discuss some applications of this formula and of another formula of this sort, the one obtained earlier by the second author, and show that both formulae may hold when the distributions are defined only outside a "reasonable" closed subset of the manifold under consideration.