  It has been known for a long time that Einstein's field equations when
projected onto a black hole horizon looks very similar to a Navier-Stokes
equation in suitable variables. More recently, it was shown that the projection
of Einstein's equation on to any null surface in any spacetime reduces exactly
to the Navier-Stokes form when viewed in the freely falling frame. We develop
an action principle, the extremization of which leads to the above result, in
an arbitrary spacetime. The degrees of freedom varied in the action principle
are the null vectors in the spacetime and not the metric tensor. The same
action principle was introduced earlier in the context of emergent gravity
paradigm wherein it was shown that the corresponding Lagrangian can be
interpreted as the entropy density of spacetime. The current analysis
strengthens this interpretation and reinforces the idea that field equations in
gravity can be thought of as emergent. We also find that the degrees of freedom
on the null surface are equivalent to a fluid with equation of state PA = TS.
We demonstrate that the same relation arises in the context of a spherical
shell collapsing to form a horizon.
