Background: Given limited evidence on opioid prescribing among patients receiving treatment for cancer during the ongoing opioid epidemic, our objective was to assess predictors of and trends in opioid receipt during cancer treatment, including how patterns differ by type of cancer. Methods: Using cancer registry data, we identified patients with a first lifetime primary diagnosis of breast, colorectal, or lung cancer from 2013 to 2017 who underwent treatment within a large cancer center network. Cancer registry data were linked to electronic health record information on opioid prescriptions. We examined predictors of and trends in receipt of any opioid prescription within 12 months of cancer diagnosis. Results: The percentage of patients receiving opioids varied by cancer type: breast cancer, 35% (1,996/5,649); colorectal, 37% (776/2,083); lung, 47% (1,259/2,654). In multivariable analysis, opioid use in the year before cancer diagnosis was the factor most strongly associated with receipt of opioids after cancer diagnosis, with 4.90 (95% CI, 4.10–5.86), 5.09 (95% CI, 3.88–6.69), and 3.31 (95% CI, 2.68–4.10) higher odds for breast, colorectal, and lung cancers, respectively. We did not observe a consistent decline in opioid prescribing over time, and trends differed by cancer type. Conclusions: Our findings suggest that prescription of opioids to patients with cancer varies by cancer type and other factors. In particular, patients are more likely to receive opioids after cancer diagnosis if they were previously exposed before diagnosis, suggesting that pain among patients with cancer may commonly include non–cancer-related pain. Heterogeneity and complexity among patients with cancer must be accounted for in developing policies and guidelines aimed at addressing pain management while minimizing the risk of opioid misuse.