We propose an evolutionary framework, the barrier theory of cancer, which is based on the distinction between barriers to oncogenesis and restraints. Barriers are defined as mechanisms that prevent oncogenesis. Restraints, which are more numerous, inhibit but do not prevent oncogenesis. Processes that compromise barriers are essential causes of cancer; those that interfere with restraints are exacerbating causes. The barrier theory is built upon the three evolutionary processes involved in oncogenesis: natural selection acting on multicellular organisms to mold barriers and restraints, natural selection acting on infectious organisms to abrogate these protective mechanisms, and oncogenic selection which is responsible for the evolution of normal cells into cancerous cells. The barrier theory is presented as a first step toward the development of a general evolutionary theory of cancer. Its attributes and implications for intervention are compared with those of other major conceptual frameworks for understanding cancer: the clonal diversification model, the stem cell theory and the hallmarks of cancer. The barrier theory emphasizes the practical value of distinguishing between essential and exacerbating causes. It also stresses the importance of determining the scope of infectious causation of cancer, because individual pathogens can be responsible for multiple essential causes in infected cells.