Genomes of bacterial and archaeal viruses are replete with fast-evolving, uncharacterized accessory genes (AGs), most of which likely antagonize host defenses or other viruses. We developed a computational pipeline to find AGs in bacteriophage genomes and built a high-throughput screening platform to assay their functions. This approach is targeted towards identifying phage proteins that target the most salient antiviral mechanisms in any bacterial niche. We tested 200 Enterobacteriophage AGs in 20 wild Escherichia coli strains challenged with 8 phages. The most prominent AG functions we observed were antagonism of O-antigen-based barrier defense and restriction-modification (R-M) systems. In response to phage-encoded anti-R-M strategies, some Type I and III R-M systems surprisingly act as programmed-cell-death modules. Moreover, several hyper-variable AGs trigger other abortive defense systems, demonstrating that phage-associated molecular patterns that activate immunity need not be well-conserved. Our approach yields insights into the multiple levels of virus-host competition and can be rapidly deployed in various bacteria.