Phase balancing is of paramount importance for power system operation. We consider a substation connected to multiple buses, each with single phase loads, generation, and energy storage. A representative of the substation operates the system and aims to minimize the cost of all buses as well as balancing loads among phases. We first consider ideal energy storage with perfect charging and discharging efficiency, and propose a distributed real-time algorithm taking into account system uncertainty. The proposed algorithm does not require any system statistics and can ensure a certain performance guarantee. We further extend the algorithm to accommodate non-ideal energy storage. The algorithm is evaluated through numerical examples and compared with a greedy algorithm.