The nuclear pregnane X receptor (PXR; NR1I2) is an important component of the body's adaptive defense mechanism against toxic substances including foreign chemicals (xenobiotics). PXR is activated by a large number of endogenous and exogenous chemicals including steroids, antibiotics, antimycotics, bile acids, and the herbal antidepressant St. John's wort. Elucidation of the three-dimensional structure of the PXR ligand binding domain revealed that it has a large, spherical ligand binding cavity that allows it to interact with a wide range of hydrophobic chemicals. Thus, unlike other nuclear receptors that interact selectively with their physiological ligands, PXR serves as a generalized sensor of hydrophobic toxins. PXR binds as a heterodimer with the 9-cis retinoic acid receptor (NR2B) to DNA response elements in the regulatory regions of cytochrome P450 3A monooxygenase genes and a number of other genes involved in the metabolism and elimination of xenobiotics from the body. Although PXR evolved to protect the body, its activation by a variety of prescription drugs represents the molecular basis for an important class of harmful drug-drug interactions. Thus, assays that detect PXR activity will be useful in developing safer prescription drugs.