Thermostatically controlled residential appliances have built-in thermodynamic storage that, even within a narrow temperature band that does not degrade the comfort level of occupants, can be used to provide a variety of value streams to power system operators and customers. In this paper, residential air conditioners and electric water heaters are used to improve feeder power factor in a distribution system where photovoltaic systems cause the feeder power factor to dip daily, increasing losses. Improving distribution feeder power factor improves the efficiency of the transmission and bulk generation systems. A daily optimal dispatch regime is used to maximize the daily minimum feeder power factor. Following this regime, electric water heaters cool off in preparation for a low-feeder-power-factor event, turn on to improve the power factor during the event and return to a neutral condition after the event. Air conditioners, which have a power factor lower than the feeder overall, are optimally dispatched in the inverse pattern. Using a model of a real commercial and residential distribution feeder in the western United States, the optimal dispatch of virtual batteries is shown to be capable of improving the daily minimum power of that feeder by as much as 0.026. The power factor correction and optimal dispatch techniques are based on a robust virtual battery framework, making them portable to other applications, such as volt-var optimization and transactive energy systems.