Once a year we get a rude reminder of just how inefficient and outdated our electrical grid is. It's usually sometime in July or August when a sweltering heat wave rolls through the East or West Coast. The grid is stretched to its max, and New Yorkers are advised to keep their air conditioners set no lower than 79 degrees because of the anticipated strain on the system. So if we have to live with these hot, muggy temperatures, we might as well know how we can profit from it.

Demand response
When the temperature heats up, EnerNOC (Nasdaq: ENOC) and Comverge (Nasdaq: COMV) work overtime to control demand on the grid. Their demand-response infrastructure pulls demand off the grid, helping prevent blackouts or brownouts when demand is at its highest.

But it's still hard to tell exactly when demand response will be needed, as was shown on Thursday when the PJM Interconnection said that demand response was not needed to meet demand. The challenge for demand response operators is the variability of the use of their services. In the third quarter last year, EnerNOC rode a heat wave to a $43.9 million profit only to be followed by $21.2 million and $19.3 million in losses in the next two quarters, respectively. Demand response will play a role in controlling our future energy demand, but these aren't stocks for people who are looking for a smooth level of earnings.

The "smart grid" build-out is a trend that will continue and may provide some more stability than demand response operators.

Smarter energy use
There has been a lot of talk about the smart grid and how it could save energy for the country. So far the reviews on a smarter grid have been mixed from customers, but utilities are investing millions of dollars in making their grids smarter.

Landis+Gyr, General Electric (NYSE: GE), and Siemens are all making meters that will provide customers with more control and feedback about their energy use. And companies like MYR Group and Quanta Services are busy upgrading infrastructure further up the supply pipeline.

Ameresco (NYSE: AMRC), one of our Stock Advisor newsletter picks, is providing energy-efficient solutions to buildings around the country. Whether it's adding solar or wind power generation at a facility, power demand management, or energy efficiency, Ameresco is a one-stop shop. The best part of Ameresco's business model is customers who are looking for cost savings are using their services. It doesn't rely on a regulated utility system or variable demand sources like I've discussed above. The company hasn't been public long, but revenue grew 38.6% in the first quarter so it is gaining traction.

Distributed solar
Another solution people are looking at more closely is distributed solar power. Unlike utility-scale solar, which are large plants of solar panels in a single location, distributed solar power covers dispersed rooftops near the source of demand. The benefit of this is that when the weather is hottest it is also generally the best time to generate solar power, leading to less stress on the grid.

New York City is starting to take steps to push rooftop solar, and after a sweltering weekend now may be the time to make a push. Mayor Michael Bloomberg's sustainability office is looking at ways to add incentives and cut the permitting bureaucracy that is holding solar back right now.

Just how big could solar power be in New York? Estimates are that 80% of rooftops are suitable for solar panels, and at peak power they could provide around 50% of the city's electricity.

A high-profile market like New York would be the perfect place for SunPower (Nasdaq: SPWRA), LDK Solar (NYSE: LDK), JA Solar (Nasdaq: JASO), and others to demonstrate solar's viability. Costs have fallen significantly in recent years, but the common perception in the market is that solar is cost prohibitive. Especially at peak times, that simply isn't the case anymore.

What to buy when the temperature heats up
My favorite stocks of this group are SunPower and Ameresco. SunPower is the efficiency leader of solar manufacturers, and Ameresco is providing a service most businesses can't perform in-house.

What stock are you buying when the temperature heats up? Tell us your pick in the comments section below.