We introduce a novel and powerful method for exploring the properties of the multidimensional free energy surfaces of complex many-body systems by means of a coarse-grained non-Markovian dynamics in the space defined by a few collective coordinates.A characteristic feature of this dynamics is the presence of a history-dependent potential term that, in time, fills the minima in the free energy surface, allowing the efficient exploration and accurate determination of the free energy surface as a function of the collective coordinates. We demonstrate the usefulness of this approach in the case of the dissociation of a NaCl molecule in water and in the study of the conformational changes of a dialanine in solution.