The equation of state of a foam