Drug resistance is a principal limitation to the long-term efficacy of cancer therapies. Cancer genome sequencing can retrospectively delineate the genetic basis of drug resistance, but this requires large numbers of post-treatment samples to nominate causal variants. Here we prospectively identify genetic mechanisms of resistance to ten oncology drugs from CRISPR base editing mutagenesis screens in four cancer cell lines using a guide RNA library predicted to install 32,476 variants in 11 cancer genes. We identify four functional classes of protein variants modulating drug sensitivity and use single-cell transcriptomics to reveal how these variants operate through distinct mechanisms, including eliciting a drug-addicted cell state. We identify variants that can be targeted with alternative inhibitors to overcome resistance and functionally validate an epidermal growth factor receptor (EGFR) variant that sensitizes lung cancer cells to EGFR inhibitors. Our variant-to-function map has implications for patient stratification, therapy combinations and drug scheduling in cancer treatment.