After four rocky years as a publicly traded company in the volatile renewable energy sector, SolarCity Corp. may now be wading into an equally uncertain future.

With a tentative agreement to be purchased by its sister company, Tesla Motors Inc., SolarCity is going all in on a strategy that some analysts say is ahead of its time: pairing solar systems with the automaker's energy-storage batteries. The company has also said it will seek to build more solar systems for utilities -- a part of the market in which SolarCity has limited experience.

Marketing rooftop solar systems with batteries has advantages, especially as state governments grow increasingly skeptical of requiring power companies to purchase extra power generated on their customers’ rooftops. With batteries, electricity generated during the sunniest parts of the day can be stored for use at night.

SolarCity said the merger has a big upside.

"We are aligning with what we believe is the most innovative manufacturer and product developer in the world," said spokesman Jonathan Bass, referring to Tesla. The combined company, he said, will be able "to accelerate the adoption of clean energy with a one-stop shop for renewable energy and battery storage.”

Tesla did not respond to a request for comment.

Battery storage remains unproven -- and expensive. A home battery, which currently costs thousands of dollars, does not yet make economic sense for most homeowners, and analysts and investors are leery of the cost and time it will take for Tesla to sell enough batteries to have a meaningful impact on its bottom line.

"We are very big, very long term believers in solar-plus-storage,” said Shawn Kravetz, president of Boston-based Esplanade Capital, which used to own SolarCity shares. “But the capital that will have to be deployed -- and the years that will have to pass before it's more than just a rounding error for SolarCity -- make it not a real factor today."

A still-evolving industry

Solar power has made great strides in recent years, and large-scale systems built to supply electricity to utilities are now competing effectively against plants powered by fossil fuels, mainly coal and natural gas.

Still, more than 900,000 rooftop systems have been installed on U.S. homes, according to the Solar Energy Industries Association, and SolarCity dominates the residential market. Installation costs have dropped by 70 percent in the last decade, making it more attractive. Investment in the sector has grown from $1.4 billion in 2006 to almost $17 billion in 2015.

But solar remains a tiny industry struggling to disrupt deeply entrenched traditional energy providers. High-profile solar failures -- such as the bankruptcies of Solyndra and SunEdison -- have spooked investors.

Moreover, the smaller rooftop systems that SolarCity markets and installs remain highly dependent on fickle government policies to make them pencil out for homeowners.

Many states also require utilities to purchase any excess power that homeowners generate with their solar systems at full retail rates. Those policies often generate opposition, however, and are under review in many states.

From the time of its debut as a public company in 2012, SolarCity has struggled to navigate in the volatile sector. The company was forced to drop the share price of its IPO by 40 percent to assuage investor jitters about solar, something SolarCity Chief Executive Lyndon Rive tried to cast in a positive light.

"They will grow with us," he said of the company’s investors on the day SolarCity went public.

At first, they did. SolarCity’s stock soared to nearly $90 by early 2014. But the honeymoon ended in 2015 and early 2016, when a combination of cheap fossil fuel prices and the cancellation of a key solar incentive in Nevada pushed SolarCity’s stock price sharply downward and into more volatile territory.

"The business was never as good as it seemed when the stock was roaring, and it was rarely as bad or nefarious as it seemed" when the stock tumbled, Kravetz said. "It had more round trips than the Delta shuttle."

In June of this year, when Tesla made its offer, SolarCity's stock was down more than 50 percent from a year earlier and 70 percent off its all-time high. On Monday, the company said it had agreed to a $2.6 billion takeover.

Today, the company’s stock is at about $24 a share, up from a May low of less than $18.

"There was really a need for them to do something," said S&P Global Market Intelligence analyst Angelo Zino. "We were a bad economic downturn away from SolarCity going belly up."

Battery-powered recovery

Most analysts agree that Solar City needed to change gears, but they remain skeptical of the contention by Tesla and SolarCity that they will be able to pair most solar installations with batteries in three to five years.

"That would be quick. That certainly hasn't been our expectation," said Shayle Kann, senior vice president of research for industry research firm Greentech Media. "If there is a big risk, it's just that it's too early."

SolarCity’s plan, announced earlier this year, to develop utility-scale solar power plants and offer energy storage products to utilities and grid operators also faces challenges.

The company launched a demonstration project with Pacific Gas & Electric last month that aims to coordinate solar with battery storage at up to 150 homes in San Jose, California.

But SolarCity will face stiff competition from entrenched players, such as SunPower Corp. and First Solar, as it works to win jobs through formal bid processes rather than relying on consumer-oriented sales pitches.

"I don't know how successful they will be on that end of things," Zino said. "When we look at SolarCity two years from now and three years from now, I believe they are still going to be a residential company."