Expressions are derived for the mass of a stationary axisymmetric solution of the Einstein equations containing a black hole surrounded by matter and for the difference in mass between two neighboring such solutions. Two of the quantities which appear in these expressions, namely the area A of the event horizon and the “surface gravity” κ of the black hole, have a close analogy with entropy and temperature respectively. This analogy suggests the formulation of four laws of black hole mechanics which correspond to and in some ways transcend the four laws of thermodynamics.