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 of X, thereby generalizing Cartan's theory of Newtonian inner balayage on Double-struck capital R-n, n > 3, to a suitable function kernel on X. As an application of the theory developed, we show that if a locally compact space X is sigma-compact and perfectly normal, then a recent result by B. 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 hold true (and are partly new) for most classical kernels on Double-struck capital R-n, n > 2, which is important in applications.