Natural products containing carbon-phosphorus bonds (phosphonic and phosphinic acids) have found widespread use in medicine and agriculture. Recent years have seen a renewed interest in the biochemistry and biology of these compounds with the cloning of the biosynthetic gene clusters for several family members. This review discusses the commonalities and differences in the molecular logic that lie behind the biosynthesis of these compounds. The current knowledge regarding the metabolic pathways and enzymes involved in the production of a number of natural products, including the approved antibiotic fosfomycin, the widely used herbicide phosphinothricin (PT), and the clinical candidate for treatment of malaria FR-900098, is presented. Many of the enzymes involved in the biosynthesis of these compounds catalyze chemically and biologically unprecedented transformations, and a wealth of new biochemistry has been revealed through their study. These investigations have also suggested new strategies for natural product discovery.