  In this paper we develop a method introduced by one of us to study metastable
states in spin glasses. We consider a `potential function' defined as the free
energy of a system at a given temperature $T$ constrained to have a fixed
overlap with a reference configuration of equilibrium at temperature $T'$. We
apply the method to the spherical p-spin glass and to some generalization of
this model in the range of temperatures between the dynamic and the static
transition. The analysis suggests a correspondence among local minima of the
potential and metastable states. This correspondence is confirmed studying the
relaxation dynamics at temperature $T$ of a system starting from an initial
configuration equilibrated at a different temperature $T'$.
