We show how distributed control of reactive power can serve to regulate voltage and minimize resistive losses in a distribution circuit that includes a significant level of photovoltaic (PV) generation. To demonstrate the technique, we consider a radial distribution circuit with a single branch consisting of sequentially-arranged residential-scale loads that consume both real and reactive power. In parallel, some loads also have PV generation capability. We postulate that the inverters associated with each PV system are also capable of limited reactive power generation or consumption, and we seek to find the optimal dispatch of each inverter's reactive power to both maintain the voltage within an acceptable range and minimize the resistive losses over the entire circuit. We assume the complex impedance of the distribution circuit links and the instantaneous load and PV generation at each load are known. We compare the results of the optimal dispatch with a suboptimal local scheme that does not require any communication. On our model distribution circuit, we illustrate the feasibility of high levels of PV penetration and a significant (20% or higher) reduction in losses.