  We consider a non-minimal coupling of a perfect fluid matter system with
geometry, which the coupling function is taken to be an arbitrary function of
the Ricci scalar. Due to such a coupling, the matter stress tensor is no longer
conserved and there is an energy transfer between the two components. By
solving the conservation equation and applying the second law of
thermodynamics, we show that direction of the energy transfer depends on the
equation of state of the matter fluid. In particular, a phantom fluid should
loose energy with expansion of the universe. This energy reduction can avoid
the universe to end with a cosmic doomsday.
