Just optimize the molecule in vaccum and in particular solvent and calculate the energy difference and use the trivial thermodynamic relations of free energy implying the energy difference.
In G09, the difference between the free energy in the gas phase and in a solvent for a given optimized gas-phase geometry is simply the difference between the SCF energies obtained in solvent (by SMD, PCM, ..., models) and in gas phase.