An improved TS algorithm is put forward on the condition that reactive power compensation location and capacity have been identified in rural distribution lines. The Algorithm is based on capacitor optimal on-off model aimed at a minimum network loss, it can control the capacitor on-off according to the load changing and the system operation status and keep real-time voltage qualified and network loss minimum. A distributed control system is designed by using the algorithm to realize reactive power optimization, which is composed of reactive power optimal terminals and background control center. The terminal is in charge of data collection and transmission, on-off instruction receiving and executing. The control center in in charge of receiving data from every compensation point, calling control algorithm to process data, forming and sending instructions. GPRS technology is adopted to realize the system’s foreground-background communication. The actual application in some experimental networks has proved that the system can realize global optimal control for distribution lines, and is suitable to be widely used in rural distribution network.