Use their elaborate tail apparatus to inject DNA into a bacterium.
Once inside, the viral genome can commandeer its host, reprogramming the cell to copy the viral nucleic acid and manufacture viral proteins.
The host provides the nucleotides, enzymes, ribosomes, tRNAs, amino acids, ATP, and other components needed for making the viral proteins provided by the viral DNA.