  We propose a general method for solving exactly the static field equations of
Einstein and Einstein-Maxwell gravity minimally coupled to a scalar field. Our
method starts from an ansatz for the scalar field profile, and determines,
together with the metric functions, the corresponding form of the scalar
self-interaction potential. Using this method we prove a new no-hair theorem
about the existence of hairy black-hole and black-brane solutions and derive
broad classes of static solutions with radial symmetry of the theory, which may
play an important role in applications of the AdS/CFT correspondence to
condensed matter and strongly coupled QFTs. These solutions include: 1) four-
or generic $(d+2)$-dimensional solutions with planar, spherical or hyperbolic
horizon topology; 2) solutions with AdS, domain wall and Lifshitz asymptotics;
3) solutions interpolating between an AdS spacetime in the asymptotic region
and a domain wall or conformal Lifshitz spacetime in the near-horizon region.
