Modular polyketide synthases (PKSs) of bacteria provide an enormous reservoir of natural chemical diversity. Studying natural biocombinatorics may aid in the development of concepts for experimental design of genes for the biosynthesis of new bioactive compounds. Here we address the question of how the modularity of biosynthetic enzymes and the prevalence of multiple gene clusters in Streptomyces drive the evolution of metabolic diversity. The phylogeny of ketosynthase (KS) domains of Streptomyces PKSs revealed that the majority of modules involved in the biosynthesis of a single compound evolved by duplication of a single ancestor module. Using Streptomyces avermitilis as a model organism, we have reconstructed the evolutionary relationships of different domain types. This analysis suggests that 65% of the modules were altered by recombinational replacements that occurred within and between biosynthetic gene clusters. The natural reprogramming of the biosynthetic pathways was unambiguously confined to domains that account for the structural diversity of the polyketide products and never observed for the KS domains. We provide examples for natural acyltransferase (AT), ketoreductase (KR), and dehydratase (DH)-KR domain replacements. Potential sites of homologous recombination could be identified in interdomain regions and within domains. Our results indicate that homologous recombination facilitated by the modularity of PKS architecture is the most important mechanism underlying polyketide diversity in bacteria.