Viruses that infect marine cyanobacteria-cyanophages-often carry genes with orthologs in their cyanobacterial hosts, and the frequency of these genes can vary with habitat. To explore habitat-influenced genomic diversity more deeply, we used the genomes of 28 cultured cyanomyoviruses as references to identify phage genes in three ocean habitats. Only about 6-11% of genes were consistently observed in the wild, revealing high gene-content variability in these populations. Numerous shared phage/host genes differed in relative frequency between environments, including genes related to phosphorous acquisition, photorespiration, photosynthesis and the pentose phosphate pathway, possibly reflecting environmental selection for these genes in cyanomyovirus genomes. The strongest emergent signal was related to phosphorous availability; a higher fraction of genomes from relatively low-phosphorus environments-the Sargasso and Mediterranean Sea-contained host-like phosphorus assimilation genes compared with those from the N. Pacific Gyre. These genes are known to be upregulated when the host is phosphorous starved, a response mediated by pho box motifs in phage genomes that bind a host regulatory protein. Eleven cyanomyoviruses have predicted pho boxes upstream of the phosphate-acquisition genes pstS and phoA; eight of these have a conserved cyanophage-specific gene (PhCOG173) between the pho box and pstS. PhCOG173 is also found upstream of other shared phage/host genes, suggesting a unique regulatory role. Pho boxes are found upstream of high light-inducible (hli) genes in cyanomyoviruses, suggesting that this motif may have a broader role than regulating phosphorous-stress responses in infected hosts or that these hlis are involved in the phosphorous-stress response.