How to calculate the force of gravity that wants to collapse a star? In astrophysics, the pressure created by the outflow of energy from the interior of the star counteracts the force of gravity that wants to collapse the star. If I want to calculate this force for a star of given Mass and Radius how should I do it? 
At the moment, I think that Newton's Law of Gravitation might be employed to solve this problem, but I don't know which pair of masses to consider. One mass could be the entire mass of the star. But what is the other mass? 
 A: The basic concept here is that of hydrostatic equilibrium.
If you consider a thin slab of material of density $\rho$ and thickness $\Delta r$ in the star. It has a pressure of $P$ below the slab and a pressure $P + \Delta P$ above the slab. The weight of the slab will be $\rho g A \Delta r $, where $A$ is the area covered by the slab and $g$ is the local value of gravity. To keep the slab in equilibrium you need to balance this weight with the force exerted upwards on the slab due to the pressure difference between the top and bottom. i.e.
$$ \rho g\ A\ \Delta r =  -\Delta P\ A$$
Thus $\rho g\ \Delta r = -\Delta P$ and as $\Delta r \rightarrow 0$, we can say
$$ \frac{dP}{dr} = -\rho(r) g(r) = - \rho \frac{GM(<r)}{r^2},$$
 where $\rho(r)$ and $g(r)$ are functions of radius within the star and $M(<r)$ is the mass contained within radius $r$.
To solve this differential equation requires a self-consistent solution of the equations of stellar structure (involving the energy generation and energy transport equations), since the pressure also depends on temperature and composition.
To make progress with this in a back-of-the-envelope kind of way then some vast simplifications are required, namely an assumption about how the density depends on radius. If we assume that the density is constant (awful, but it does give the right proportionalities) then
$$\frac{dP}{dr} = - \frac{G \rho}{r^2} \frac{4\pi}{3} \rho r^3$$
$$ \int^{0}_{P(r)} dP = - \frac{4\pi G \rho^2}{3} \int^{R}_{r} r\ dr,$$
where $P=0$ at the surface of the star where $r=R$.
$$ P(r) = \frac{2\pi G \rho^2}{3} (R^2 - r^2)$$
Then we could put this in terms of the mass of the star $M$ by noting that $\rho =3M/4\pi R^3$
$$ P(r) = \frac{2\pi G}{3}\left(\frac{3M}{4\pi R^3}\right)^2 (R^2 - r^2) = \frac{3G}{8\pi}\left(\frac{M^2}{R^4}\right)\left(1 -\frac{r^2}{R^2}\right), $$ 
and the central pressure (at $r=0$) would be
$$P(0) = \frac{3G}{8\pi} \left(\frac{M^2}{R^4}\right)$$
The proportionality is correct here, but comparison with a real star, like the Sun reveals that whilst the average pressure is reasonable, the central pressure is a couple of orders of magnitude too low, because the density of the Sun is not constant - the pressure and density are much higher in the centre. 
A: What you are asking for is something called Gravitational collapse

Gravitational collapse is the condensing of an astronomical object due to the influence of its own gravity, which tends to draw matter inward toward the center of mass. Gravitational collapse is a fundamental mechanism for structure formation in the universe. Over time an initial relatively smooth distribution of matter will collapse to form pockets of higher density, typically creating a hierarchy of condensed structures such as clusters of galaxies, stellar groups, stars and planets.

Reference: https://en.wikipedia.org/wiki/Gravitational_collapse
For a more mathematical answer check out the pressure term in Einstein's equation here: http://math.ucr.edu/home/baez/einstein/node6.html
Update:
Jean's Mass
The concept of the Jean's Mass as the critical mass for collapse into a star is an important concept. The "Jean's mass" is the minimum mass that can overcome the radiation pressure for a given energy density in radiation.
Virial theorem
Gravity can be applied to a finite collection of particles which interact with each other by gravitational attraction. We can attribute to the collection of particles a total gravitational potential energy and a total kinetic energy. The virial theorem states that
Average kinetic energy = $\boldsymbol {-\frac {1}{2} \times}$ Average potential energy
One application of this theorem would be to a known mass of hydrogen gas in a proto-star. If you had a good estimate of the mass of the gas and could measure a sample of particle velocities to determine the kinetic energy, then you could predict the kinetic energy as the gas cloud underwent gravitational collapse. So for a given radius of collapse, you could make a prediction of the temperature of the hydrogen gas in terms of the kinetic energy and could make a prediction about when it would reach the ignition temperature for hydrogen fusion.
