  We develop a theory of inner balayage of a positive Radon measure $\mu$ of
finite energy on a locally compact space $X$ to arbitrary $A\subset X$,
generalizing Cartan's theory of Newtonian inner balayage on $\mathbb R^n$,
$n\geqslant3$, to a suitable function kernel on $X$. As an application of the
theory thereby established, we show that if the space $X$ is perfectly normal
and of class $K_\sigma$, then a recent result by Bent Fuglede (Anal. Math.,
2016) on outer balayage of $\mu$ to quasiclosed $A$ remains valid for arbitrary
Borel $A$. We give in particular various alternative definitions of inner
(outer) balayage, provide a formula for evaluation of its total mass, and prove
convergence theorems for inner (outer) swept measures and their potentials. The
results obtained do hold (and are new in part) for most classical kernels on
$\mathbb R^n$, $n\geqslant2$, which is important in applications.
