First Solar Inc., the solar manufacturer that gets almost two-thirds of sales from building and selling utility-scale power plants, agreed to buy TetraSun, a startup developing photovoltaic technology for rooftops.