  We present a general procedure to construct the first law of thermodynamics
on the apparent horizon and illustrate its validity by examining it in some
extended gravity theories. Applying this procedure, we can describe the
thermodynamics on the apparent horizon in Randall-Sundrum braneworld imbedded
in a nontrivial bulk. We discuss the mass-like function which was used to link
Friedmann equation to the first law of thermodynamics and obtain its special
case which gives the generalized Misner-Sharp mass in Lovelock gravity.
