In this paper, a novel optimal relay angle-based clustering routing protocol called RACR is proposed to balance nodes’ energy consumption and prolong the network lifespan of wireless sensor networks (WSNs). In RACR, each node considers the parameters residual energy, number of neighbors, and average distance with neighbors as a criteria to determine whether to become a cluster head (CH) which cooperates with its neighbors to form a cluster. Afterward, the optimal relay angle is calculated for each CH to find its best relay node according to a target function considering the least energy consumption, which is applied to reduce the search range for finding routing paths. Consequently, all the CHs can find their best next-hop nodes within the determined field according to their residual energy, distance to the next-hop CH, and loads. Iteratively, the CHs obtain their best routing paths to the BS in the end. Simulation results demonstrate its effectiveness of RACR in terms of energy consumption, standard deviation of residual energy, data communication delay, network throughput, and lifespan.