There is increasing evidence that uncultivated bacterial symbionts are the true producers of numerous bioactive compounds isolated from marine sponges. The localization and heterologous expression of biosynthetic genes could clarify this issue and provide sustainable supplies for a wide range of pharmaceuticals. However, identification of genes in the usually highly complex symbiont communities remains a challenging task. For polyketides, one of the most important groups of sponge-derived drug candidates, we have developed a general strategy that allows one to rapidly access biosynthetic gene clusters based on chemical moieties. Using this method, we targeted polyketide synthase genes from two different sponge metagenomes. We have obtained from a sponge-bacterial association a complete pathway for the rare and potent antitumor agent psymberin from Psammocinia aff. bulbosa. The data support the symbiont hypothesis and provide insights into natural product evolution in previously inaccessible bacteria.