Classical black holes and event horizons are highly non-local objects, defined in terms of the causal past of future null infinity. Alternative, (quasi)local definitions are often used in mathematical, quantum and numerical relativity. These include apparent, trapping, isolated and dynamical horizons, all of which are closely associated with 2-surfaces of zero outward null expansion. In this paper, we show that 3-surfaces which can be foliated with such 2-surfaces are suitable boundaries in both a quasilocal action and a phase space formulation of general relativity. The resulting formalism provides expressions for the quasilocal energy and angular momentum associated with the horizon. The values of the energy and angular momentum are in ag...