One very useful concept in classical
mechanics is gravitational
flux. If the gravitational
acceleration through an area A has
a constant value of g and is perpendicular to the area, the total flux through that area is g*A. In the general case, the total flux is
acceleration . dA integrated over the area. (Acceleration is a
vector, and area can be represented by a vector
perpendicular to the
area.)
We can calculate the gravitational flux through an enclosed area caused by a point mass m. If m is outside the area, the net flux
it causes is zero, because all the "lines of gravitational force" going towards m which enter the enclosure from one side leave it
from the other. If M is inside the area, we work this out in terms of solid angles centred on m. An area which subtends a solid
angle of dW steradians and is at a distance R from m will have a component of dA = dW*R^{2} perpendicular to the
imaginary line joining it to m  that's the definition of solid angles.

m<> dA
R 
The element of area need not be perpendicular to the vector R, but only the component which is perpendicular enters into the
calculation of the solid angle or the total flux.
The gravitational acceleration at a distance R from the mass m is equal to G m / R^{2}, where G is the gravitational
constant. Thus the flux over that area element is
acceleration . dA = (G m / R^{2}) . (dW R^{2}) = G m dW
Since the solid angle subtended by the whole enclosure on m is 4 pi, the total gravitational flux through it is 4 pi G m. And since
we can think of any distribution of mass as being made up of infinitely many point masses, the total gravitational flux through an
enclosure is always 4 pi G M where M is the total mass enclosed.
We can use this for an elegant way to calculate the gravitational field of a hollow spherical shell of mass M. First note that the
field must be radial (pointing towards or away from the centre of the sphere) by symmetry. Consider the flux through an
imaginary spherical enclosure with the same centre as the shell. If the enclosure is inside the shell, the flux through it is zero
because it encloses no mass, so the gravitational field inside the shell must be zero too. If the enclosure is outside the shell, the
total flux through it is:
Flux = 4 pi G M = a * 4 pi R^2
where R is the radius of the enclosure and a is the acceleration at any point on the enclosure (we know that a is constant because of
the spherical symmetry). So we can deduce that a = G M / R^{2}, as if the hollow shell were a point mass.