The facultative endosymbiont of aphids, Hamiltonella defensa, kills parasitoid wasp larvae, allowing aphid hosts to survive and reproduce. This protection may depend on toxins that are encoded by the genomes of H. defensa and of its bacteriophage (APSE). Strains of H. defensa vary in degree of protection conferred upon Acyrthosiphon pisum (pea aphid). Although H. defensa is known to undergo some horizontal transmission among aphid maternal lineages, divergence, recombination, and population structure in H. defensa and APSE have not been characterized. We performed a multilocus sequence analysis of 10 bacterial and five phage loci for strains isolated from A. pisum and other aphid species. The H. defensa chromosome was found to be largely clonal, allowing us to generate a well-resolved H. defensa strain phylogeny. In contrast, APSE chromosomes undergo recombination and numerous H. defensa strains have probably lost the phage. Within a set of H. defensa strains that are indistinguishable on the basis of chromosomal genes or restriction digests of chromosomal fragments, loss of APSE is associated with decreased protection, strongly suggesting that APSE-encoded genes contribute to the defensive phenotype. Thus, homologous recombination of APSE genes and sexual transmission of symbionts and phage are likely factors influencing the exchange of ecologically important genes among symbionts. Although H. defensa has been lost, transferred and gained within A. pisum, one subclade of H. defensa appears to be universal within a subclade of the aphid genus Uroleucon, suggesting a transition from facultative, horizontal transmission to strictly vertical inheritance.