A coherent framework is presented for determining the free energy change accompanying ligand binding to protein receptors. The most important new feature of the method is the contribution of the flexibility of the free ligand, and hence its conformational change on binding, to the free energy. Flexibility introduces two additional terms in the free energy difference: the internal energy difference between the ligand in the bound and free states and the backbone entropy loss. The former requires taking explicit account of the difference in solvation of the various forms of the free ligand. The solvation free energy change is estimated using an atomic solvation parameter model [Eisenberg & Mclachlan (1986) Nature 319, 199-203], with an improved parameter set. In order to evaluate the method, we applied it to three data sets for which increasingly general methods are required. The set to which the most restrictive theory can be applied consists of eight crystallized endopeptidase--protein inhibitor complexes which do not change conformation on binding and for which the major contribution to the solvation free energy is entropic. The results are in good agreement with the measured values and somewhat better than those previously reported in the literature. The second data set compares the relative binding free energies of biotin and its analogs for streptavidin. In this case the structures are also rigid, but solvation free energy must include both enthalpic and entropic components. We find that differential free energy predictions are approximately the same as those obtained by free energy perturbation techniques. The final application is an analysis of the measured stabilities of 13 different MHC receptor-peptide complexes. In this case we show that flexibility contributes 30-50% of the free energy change and find a correlation of 0.88 between our predicted free energies and peptide dissociation times.