A good way to take the temperature of a changing economy is to look at what kinds of companies are going public. In 2012, initial public offering proceeds fell by almost a third, hammered by domestic slack, uncertainty in the Eurozone, the Chinese slowdown, and the flop of Facebook, the most-hyped IPO in recent memory. Last year, there were 257 American IPOs; so far this year, only 132. As a rule, only companies operating in hot sectors can confidently float public offerings these days. So, for example, as American housing comes back, homebuilder Taylor Morrison Home Corporation recently filed for a $250 million offering; on Friday, Silver Bay Realty Trust will stage a $300 million IPO. And despite the Facebook debacle, almost a third of this year’s American offerings have been tech companies, with the lagging manufacturing sector accounting for just 12 deals.

American energy businesses accounted for 23 big deals this year. But not all of them were in drillers, natural gas, or oil. On Thursday, Elon Musk, the PayPal-founding, spacefaring South Africa–born entrepreneur, took his green-energy company, SolarCity, public, raising $141 million in a much-buzzed debut. Solar companies haven’t always done well—just mention Solyndra, and people start running for the doors. But Musk bucked the trend. SolarCity’s stock closed 47 percent above its initial $8-a-share offering price. That makes the already-rich Musk even richer. According to investment filings, the entrepreneur owned 31 percent of SolarCity going into the IPO: at $8 a share, those shares would have been worth about $151 million. Now, his stake is worth at least $220 million.

SolarCity had a few things going for it. First, it isn’t in the manufacturing business; it helps other companies finance and install solar panels, and then sells them the energy the panels produce through power-purchase-agreements. Then there’s the star power of Musk himself, who also helms Tesla Motors, the electric-car manufacturer that’s seen its stock rise more than 20 percent this year alone. Oh, and he put the first private rocketship in space and served as Jon Favreau’s inspiration for Tony Stark in the Iron Man film series.

But the newfound success of cleantech standouts like Tesla and SolarCity also has a lot to do with how Silicon Valley stars are shaking up yet another market, this time with the help of the federal government. Guys like Musk—who cut their teeth in the dotcom Wild West, won the freewheeling ’90s, and made a heap of money—are now looking for bigger projects than pet social networks and iPhone apps. They want to change the world.

Elon Musk turned over PayPal to Ebay for $1.5 billion in 2002, walking away with more than $170 million for himself. Now, he and other venture gurus are turning their capital toward big, global, social-minded projects, starting with energy. These types of businesses pose a different challenge. You can’t just sit down with 15 bright MIT grads, come up with some ingenious photo-filters —or an online pinboard for sharing recipes and pictures of shoes—and sell it for a billion dollars a year later. Getting solar, wind, or wave power to work requires marrying smart technology to often-finicky government policy.

It’s not enough just to develop a cool electric car, or to come up with a smart way to roll out solar panels.

The business models of electric-car companies, solar-panel financiers, and alternative-fuel producers rely in large measure on the welter of state and federal subsidies, tax credits, and incentives. And so, the post-boom, save-the-world crowd has to start filing the right applications for subsidies, talking to zoning lawyers, and sitting down with gray-haired officials. The disrupters have to team up with the bureaucrats. SolarCity’s innovation isn’t in producing power; it’s in threading the needle of regulatory systems to devise a profitable method of financing the installation of solar panels.

Musk isn’t the only one doing it. There's Vinod Khosla, the Indian-born founder of Sun Microsystems, who has pumped more than a billion dollars into cleantech businesses, from bioplastics to wind to solar. Many of them would be unviable without government support.

The problem for these companies, and for their investors, is that public policy can change rapidly. The wind industry lives and dies with the expiration of the temporary wind energy tax production credit, which is set to expire at the end of 2012. Electric-car makers are getting a boost from new regulations mandating greater fuel efficiency. But a President Rubio, acting with a Republican Congress in 2016, could easily change those. And that would upset plenty of business models.

That’s the question with Musk’s enterprises. SpaceX, his private spaceflight business, recently made a trip to the International Space Station: the crowning achievement of government-managed global aeronautics. Closer to home, Musk is planning another IPO coup. On Wednesday, he tweeted, “SpaceX will go public at some point, as I think it should ultimately be owned primarily by the public.” When—and how well—will have as much to do with stodgy feds as it does with the dynamic market.