Optimality models constitute one of the simplest approaches to understanding phenotypic evolution. Yet they have shortcomings that are not easily evaluated in most organisms. Most importantly, the genetic basis of phenotype evolution is almost never understood, and phenotypic selection experiments are rarely possible. Both limitations can be overcome with bacteriophages. However, phages have such elementary life histories that few phenotypes seem appropriate for optimality approaches. Here we develop optimality models of two phage life history traits, lysis time and host range. The lysis time models show that the optimum is less sensitive to differences in host density than suggested by earlier analytical work. Host range evolution is approached from the perspective of whether the virus should avoid particular hosts, and the results match optimal foraging theory: there is an optimal "diet" in which host types are either strictly included or excluded, depending on their infection qualities. Experimental tests of both models are feasible, and phages provide concrete illustrations of many ways that optimality models can guide understanding and explanation. Phage genetic systems already support the perspective that lysis time and host range can evolve readily and evolve without greatly affecting other traits, one of the main tenets of optimality theory. The models can be extended to more general properties of infection, such as the evolution of virulence and tissue tropism.