A general method of investigating parasite population genetics is presented and used to investigate the evolution of drug resistance in Plasmodium. The most important biological factor is the nature of the control, presumably through host immunity, of the malarial infection. Two models are examined: a 'generalized immunity' (GI) model in which immunity regulates the overall level of infection, and a 'specific immunity' (SI) model in which each clone within the infection is regulated independently. These models are used to investigate 3 critical factors in the evolution of resistance: (i) the frequency of resistant alleles in the population prior to drug use, (ii) the dynamics of resistance following drug application and (iii) the magnitude of threshold frequencies below which resistance will not evolve. These analyses also identify the implicit assumptions made in several previous models, reconcile their differing conclusions and allow a more informed debate about the practical application of drugs.