Plants cope with the environmental challenges of their sessile life by producing a diverse array of secondary metabolites. Developments in the "omics" toolkit are speeding our understanding of the evolutionary basis of this chemical diversity. Three genomic signatures of secondary metabolism are emerging: genetic clustering, convergence, and increased variation. I will test the importance of these three processes by studying three pathways of ecological and economic importance - anthocyanins, steroidal glycoalkaloids, and cucurbitacins - in two diverse plant families - the Solanaceae and the Cucurbitaceae. By comparing genomic regions governing these pathways among large numbers of plants I will infer the evolutionary trajectories of secondary metabolism genes. Because differences in the structures of these genomic regions can markedly alter the pharmaceutical and biological activities of specialized metabolites this work can create valuable tools for metabolic engineering.