Sampling receptor flexibility is challenging for database docking. We consider a method that treats multiple flexible regions of the binding site independently, recombining them to generate different discrete conformations. This algorithm scales linearly rather than exponentially with the receptor's degrees of freedom. The method was first evaluated for its ability to identify known ligands of a hydrophobic cavity mutant of T4 lysozyme (L99A). Some 200000 molecules of the Available Chemical Directory (ACD) were docked against an ensemble of cavity conformations. Surprisingly, the enrichment of known ligands from among a much larger number of decoys in the ACD was worse than simply docking to the apo conformation alone. Large decoys, accommodated in the larger cavity conformations sampled in the ensemble, were ranked better than known small ligands. The calculation was redone with an energy correction term that considered the cost of forming the larger cavity conformations. Enrichment improved, as did the balance between high-ranking large and small ligands. In a second retrospective test, the ACD was docked against a conformational ensemble of thymidylate synthase. Compared to docking against individual enzyme conformations, the flexible receptor docking approach improved enrichment of known ligands. Including a receptor conformational energy weighting term improved enrichment further. To test the method prospectively, the ACD database was docked against another cavity mutant of lysozyme (L99A/M102Q). A total of 18 new compounds predicted to bind this polar cavity and to change its conformation were tested experimentally; 14 were found to bind. The bound structures for seven ligands were determined by X-ray crystallography. The predicted geometries of these ligands all corresponded to the observed geometries to within 0.7A RMSD or better. Significant conformational changes of the cavity were observed in all seven complexes. In five structures, part of the observed accommodations were correctly predicted; in two structures, the receptor conformational changes were unanticipated and thus never sampled. These results suggest that although sampling receptor flexibility can lead to novel ligands that would have been missed when docking a rigid structure, it is also important to consider receptor conformational energy.