Energy management is critical for solar-powered sensor networks. In this article, we consider data routing policies to optimize the energy in solar powered networks. Motivated by multipurpose sensor networks, the objective is to find the best network policy that maximizes the minimal energy among nodes in a sensor network, over a finite time horizon, given uncertain energy input forecasts. First, we derive the optimal policy in certain special cases using forward dynamic programming. We then introduce a greedy policy that is distributed and exhibits significantly lower complexity. When computationally feasible, we compare the performance of the optimal policy with the greedy policy. We also demonstrate the performance and computational complexity of the greedy policy over randomly simulated networks, and show that it yields results that are almost identical to the optimal policy, for greatly reduced worst-case computational costs and memory requirements. Finally, we demonstrate the implementation of the greedy policy on an experimental sensor network.