There exists a strong mathematical resemblance between the on-horizon structure of the gravitational field equations and the first law of thermodynamics. In this talk, we discuss how such a structure arises and show that the field equations near any static horizon can be written as: TdS-dE PdV. Moreover, the result extends beyond Einstein theory and holds for Lanczos-Lovelock Lagrangians as well. The entropy S we obtain is precisely the Noether charge entropy of Wald, and E provides a natural generalization of quasi-local energy of the horizon. We comment on several implications of this result, particularly the notion of gravitational entropy [treated as the Noether charge of diffeomorphism invariance] associated with horizons and it's role in gravitational dynamics arising out of virtual displacements of the horizon. © 2010 IOP Publishing Ltd.