Free space optical communication (FSO) has emerged as an alternative backhauling technology. It provides a line-of-sight (LOS) link with a capacity comparable to fiber optics and much higher than those that can be supported by radio counterparts. Rotary-wing unmanned aerial vehicles (UAVs) equipped with FSO terminals can be positioned as a complementary aerial solution to the terrestrial backhaul links in dense areas with high-peak traffic demands. In this paper, we consider a solar-powered rotary-wing UAV equipped with an FSO terminal that provides backhaul link to a ground base station in an urban area. We first quantity the energy consumption and energy harvesting of a rotary-wing solar-powered UAV. Then, we formulate an optimization problem to determine the optimal operation altitude with the goal of maximizing the net energy of UAV while satisfying the LOS requirements critical for the FSO link. Our results show that the selection of operation altitude is highly dependent on the weight of the UAV as well as the size and efficiency of the solar panel.