Tesla Motors announced Monday that it has reached a deal to buy SolarCity (San Mateo-based provider of energy services), the next step in Elon Musk's plan to combine his electric-car and solar-energy companies. It's already a family affair: Musk, Tesla's chief executive, owns about 21% of SolarCity and serves as chairman. His cousins Lyndon R. Rive and Peter J. Rive are SolarCity's chief executive and chief technology officer, respectively. The independent members of both companies' boards approved the $2.6-billion all-stock deal, Tesla said. Tesla said it expects to have cost synergies of $150 million in the first year after the deal closes. Tesla said it expects the deal to close in the fourth quarter, although the proposal must still be approved by a majority of the disinterested shareholders of Tesla and SolarCity and requires regulatory approval. It also contains a "go shop" provision that gives SolarCity 45 days to "solicit, discuss or negotiate alternative proposals from third parties."