Vertebrate immune system molecules that bind directly to parasites are commonly subject to strong directional natural selection, probably because they are engaged in an evolutionary arms race with parasites. We have investigated whether similar patterns of evolution are seen in components of the Drosophila immune system that bind parasite-derived molecules. In insects, TEPs (thioester-containing proteins) function as opsonins, binding to parasites and promoting their phagocytosis or encapsulation. The Drosophila melanogaster genome encodes four TEPs, three of which are upregulated after an immune challenge. We report that two of these three Drosophila genes evolve rapidly under positive selection and that, in both TepI and TepII, the "bait-like region" (also known as the variable region) shows the strongest signature of positive selection. This region may be the site of proteolytic cleavage that leads to the activation of the molecule. It is possible that the proteolytic activation of TEPs is a target of host-parasite coevolution, with parasites evolving to prevent proteolysis, which in turn favors mutations in the bait-like region that restore the response. We also sequenced three gram-negative binding proteins (GNBPs) and two immune-induced peptides with strong homology to the GNBPs. In contrast to the Tep genes, the GNBP genes are highly conserved. We discuss the reasons why different components of the immune system have such different patterns of evolution.