Pressure gradient force equals the gravitational force
The hydrostatic equation says that the change in pressure with height (the pressure gradient) is equal to density times gravity.
dp/dz = -rho *g
where dp is the change in pressure, dz is the change in height, rho is density, and g is gravity.
Equation of state
But density gets messy and we would like to substitute other terms for rho. In comes the equation of state (a form of the Ideal Gas Law). This states that: p = rho*Rd*T, where p is pressure, Rd is the dry gas constant, and T is temperature. We can then say:
rho= p/Rd*T
Hypsometric equation
We can then use this to get the hypsometric equation which relates atmopsheric thickness to the temperature. A good description of the derivation of this from Millersville University is in the related links. An example of atmospheric thickness between the 1000 and 500 mb pressure levels is shown below.