We examine the total mixed scalar curvature of a smooth manifold endowed with a distribution as a functional of a pseudo-Riemannian metric. We develop variational formulas for quantities of extrinsic geometry of the distribution and use this key and technical result to find the critical points of this action. Together with the arbitrary variations of the metric, we consider also variations that preserve the volume of the manifold or partially preserve the metric (e.g., on the distribution). For each of those cases, we obtain the Euler-Lagrange equation and its several solutions. Examples of critical metrics that we find are related to various fields of geometry such as contact and 3-Sasakian manifolds, geodesic Riemannian flows, codimension-one foliations, and distributions of interesting geometric properties (e.g., totally umbilical and minimal).