  The field equations of a generalized $f(R)$ type gravity model, in which
there is an arbitrary coupling between matter and geometry, are obtained. The
equations of motion for test particles are derived from a variational principle
in the particular case in which the Lagrange density of the matter is an
arbitrary function of the energy-density of the matter only. Generally, the
motion is non-geodesic, and takes place in the presence of an extra force
orthogonal to the four-velocity. The Newtonian limit of the model is also
considered. The perihelion precession of an elliptical planetary orbit in the
presence of an extra force is obtained in a general form, and the magnitude of
the extra gravitational effects is constrained in the case of a constant extra
force by using Solar System observations.
