While genetic tumor heterogeneity has long been recognized, recent work has revealed significant variation among cancer cells at the epigenetic and transcriptional levels. Profiling tumors at the single-cell level in individual cancer types has shown that transcriptional heterogeneity is organized into cancer cell states, implying that diverse cell states may represent stable and functional units with complementary roles in tumor maintenance and progression. However, it remains unclear to what extent these states span tumor types, constituting general features of cancer. Furthermore, the role of cancer cell states in tumor progression and their specific interactions with cells of the tumor microenvironment remain to be elucidated. Here, we perform a pan-cancer single-cell RNA-Seq analysis across 15 cancer types and identify a catalog of 16 gene modules whose expression defines recurrent cancer cell states, including 'stress', 'interferon response', 'epithelial-mesenchymal transition', 'metal response', 'basal' and 'ciliated'. Using mouse models, we find that induction of the interferon response module varies by tumor location and is diminished upon elimination of lymphocytes. Moreover, spatial transcriptomic analysis further links the interferon response in cancer cells to T cells and macrophages in the tumor microenvironment. Our work provides a framework for studying how cancer cell states interact with the tumor microenvironment to form organized systems capable of immune evasion, drug resistance, and metastasis.