  We extend the quasilocal (metric-based) Hamiltonian formulation of general
relativity so that it may be used to study regions of spacetime with null
boundaries. In particular we use this generalized Brown-York formalism to study
the physics of isolated horizons. We show that the first law of isolated
horizon mechanics follows directly from the first variation of the Hamiltonian.
This variation is not restricted to the phase space of solutions to the
equations of motion but is instead through the space of all (off-shell)
spacetimes that contain isolated horizons. We find two-surface integrals
evaluated on the horizons that are consistent with the Hamiltonian and which
define the energy and angular momentum of these objects. These are closely
related to the corresponding Komar integrals and for Kerr-Newman spacetime are
equal to the corresponding ADM/Bondi quantities. Thus, the energy of an
isolated horizon calculated by this method is in agreement with that recently
calculated by Ashtekar and collaborators but not the same as the corresponding
quasilocal energy defined by Brown and York. Isolated horizon mechanics and
Brown-York thermodynamics are compared.
