Tesla has been in the news lately following a fatal accident in Florida involving one of its Model S electric cars running on autonomous cruise control, called Autopilot. Discussions about the future of self-driving cars have overtaken a matter involving Tesla of more near-term interest: Telsa CEO Elon Musk’s offer to purchase SolarCity (where Mr. Musk serves as board chairman) for between $23.96 and $25.73 per share, a 25% premium over SolarCity’s stock price. Mr. Musk said that bringing electric cars, solar panels and battery storage under one corporate roof would produce operational synergies and create “the potential for Tesla to be a $1 trillion market cap company.” That’s about 32 times Tesla’s current valuation. Neither company, though aided considerably by government renewable-energy subsidies, has ever recorded an annual profit. Last year Tesla lost $889 million-nearly three times as much as in 2014-while SolarCity’s loss doubled to $769 million. Investors may be feeling déjà vu as a shadow has fallen over the solar industry. In April, the renewable-energy conglomerate SunEdison filed for chapter 11 bankruptcy following an Icarus-like fall. A year ago, former CEO Ahmad Chatila predicted that his company would be worth $350 billion by 2020-about 35 times its market capitalization at the time. Nine months later, the stock price had plunged by 99%, to 21 cents per share. SunEdison’s stock first began to tumble last July when Mr. Chatila proposed paying $2.2 billion for the rooftop-solar installer Vivint Solar (the deal was scrapped in March), which activist investors lambasted as overpriced. It soon became clear that SunEdison’s growth, enabled by debt and complicated financial engineering, was unsustainable. Notwithstanding Mr. Chatila’s sunny forecasts, the company had failed to earn a profit in five years. An internal probe in April faulted a lack of accounting controls and an “overly optimistic culture and its tone at the top.” The Tesla-SolarCity deal is an all-stock exchange, but the SunEdison fiasco is a flashing yellow light. Tesla aims to crank out 500,000 Model 3 sedans in 2018-about 10 times its total deliveries last year-and one million annually by 2020. Yet it isn’t clear how fast the company will be able to ramp up production at its not-yet-completed Gigafactory in Reno, Nev., and whether demand for the mass-market electric sedans will meet Mr. Musk’s goals. Only 115,000 electric cars were sold last year nationwide, about 0.7% of total US car sales. SolarCity has also repeatedly missed installation targets and faces strong headwinds. Utility electric-rate increases have slowed amid softening commodity prices, which has dampened demand for solar installations. Industry regulators in many states have reduced or are considering scaling back net metering, which pays customers the retail power rate for the excess generation that they remit to the grid. After Nevada slimmed down its net-metering subsidies last year, SolarCity stopped doing business in the state. Kroll Bond Rating Agency recently warned that changes to net metering like Nevada’s may prompt solar customers to renegotiate their contracts with companies such as SolarCity. A reduction in rates would decrease cash “available to the solar company, debtholders or tax equity investors”-more dark clouds for the solar business. Yet the relentless government push for renewable energy and electric cars works in favor of Tesla and SolarCity. In 2013, eight states led by California required that 3.3 million electric cars be on the road by 2025. Over the past three years, Tesla has made $580 million from selling “zero emissions vehicle” credits to other auto makers. Demand for these credits could soar as auto makers scramble to comply with the law, and as Tesla ramps up its Model 3 production, Mr. Musk will have plenty to sell.