The main problem here is that viral genomes lack universal gene markers. You have to identify first the type of bacteriophage you are working on for only then select a target gene. In some groups DNA polymerase gene have been used, for example (which can be absent in retroviruses).
I recommend you this article, which tries to address this problem:
Thanks for Salvador and Andrew for your precious information. I also thought that capsid and tail protein genes may have specificity as they provide specific recognizing and protection feature for the phage assist it to infect its host, additionally the polymerase coding gens could be helpful to recognize phage according to their phage-specific features. The problem here, is when you try to design a primers to be universal for viral family you can not find (by multiple alignment) acceptable conserved area even for primers so, you have to design specific primers for each one which will be time consuming.