We perform a phase space analysis of a generalized modified gravity theory with nonminimally coupling between geometry and matter. We apply the dynamical system approach to this generalized model and find that in the cosmological context, different choices of Lagrangian density will apparently result in different phases of the Universe. By carefully choosing the variables, we prove that there is an attractor solution to describe the late time accelerating universe when the modified gravity is chosen in a simple power-law form of the curvature scalar. We further examine the temperature evolution based on the thermodynamic understanding of the model. Confronting the model with supernova type Ia data sets, we find that the nonminimally coupled theory of gravity is a viable model to describe the late time Universe acceleration.