The night sky is aflame on the Great Plains, a byproduct of the state’s oil boom. Mark Wald came home to see if he could use it to light homes.

In a quiet corner of North Dakota, farmers Wanda and Frank Leppell gaze out their front window at an oil well that sits 750 feet from their house. Above the hypnotic bobbing of the oil well head, they watch a flare that’s burning off natural gas into the atmosphere. “It sounds like a blowtorch,” says Wanda, who’s been pushing state legislators to set oil wells farther from homes. “When you go to bed tonight, put a blowtorch in your bedroom, crank it up, and see how well you sleep.”

They’re not the only ones up at night. In North Dakota’s oil country, a region that’s seen a 600 percent increase in oil production in the last five years, drivers can see dozens of flares from the highway after dark, some burning 20 feet into the air, releasing excess natural gas from the oil rigs. A satellite image of the United States at night shows rural North Dakota lit up like a city. The state is, quite literally, on fire.

MORE: What If Your Hometown Was Awash in Cash Overnight?

And the flames won’t go out anytime soon. Ever since oil companies figured out they could tap the 170 billion barrels of crude oil underground with the new technology known as fracking, they’ve been digging wells as fast as they can, producing a modern-day black gold rush. The boom, which began in 2007, has attracted thousands of workers, lured by word that 22-year-olds with no previous job experience to speak of were suddenly raking in $100,000 a year. Temporary camps were hastily assembled to house the newcomers. As the rest of the country wrestled with recession, North Dakota’s unemployment rate dropped to 3 percent—the lowest in the nation. The cost of living shot up. Crime soared. But as long as the ground keeps gushing, there’s no incentive to slow down. Today, there are more than 8,800 active wells in the state, producing 783,000 barrels of oil a day. Local officials estimate they’ll drill 42,000 more wells in coming years, and there could be a roaring natural gas flare on every one.

The problem is, the drilling releases thousands of cubic feet of natural gas. Oil companies burn off one-third of the natural gas they’re extracting, according to a recent study—which in May 2013 amounted to over 266,000 thousand cubic feet spewing into the air every day, a number that has nearly tripled since 2011. (In comparison, Texas flares less than 1 percent of its natural gas.) By failing to capture the gas, companies in North Dakota are essentially burning away more than $100 million every month. The state’s boom has happened so quickly, companies simply haven’t had time to build the pipelines needed to capture the gas. The flares carry toxins; they emit as much carbon dioxide as a million cars do every year. More than 60 types of pollutants have been identified downwind from flaring operations—many of which are known to cause cancer and other diseases with prolonged exposure. The fact that oil’s market value is currently 30 times that of natural gas may have slowed the search for a solution.

But a native son may have found one—and figured out a way to convert the gas waste into power to heat homes and fuel factories.

[ph]

Mark Wald, born in Dickinson, N.D., had returned home to visit family at the dawn of the boom when he first began to ponder the problem. “You didn’t have to drive far to see flares everywhere,” he says. “Everybody looks at it and scratches their head, and I thought, there’s got to be a better way. What can we do with it?”

Like a lot of young men of his generation, Wald had left the state after graduating from college (North Dakota University, with degrees in aviation and business); there was little opportunity at the time. He liked to hunt pheasant and fish, but he wanted a career, and he craved the excitement of a big city. He eventually moved to Seattle, and spent 23 years in telecommunications. But the sight of the night flares lured him home.

Amazed at the amount of natural gas being wasted, he began brainstorming with his brother—equally new to the subject, after years in pharmaceutical sales. Nobody seemed to have the answer, so they left their jobs out west and moved back to start Blaise Energy in 2008. They hired an engineer and started talking to everyone they could. Wald applied for grants, and received $375,000 in state research funds in December 2009. An idea emerged: to use a mobile generator at each oil well site that could capture the natural gas, convert it to electricity and sell it back to the power grid. According to their calculations, each well could power about 40 homes this way.

ALSO: How Used Cooking Oil Can Have an Extraordinary Second Life

At a well, the drilling process brings up oil, frack water (the chemical- and sand-infused salt water used in the fracking process) and natural gas from the ground. A treatment device separates each of them, and the oil and water are sent to tanks that are trucked off site, while the gas is flared. Wald figured they could intercept the gas, run it through their customized generator, and deliver the electricity to the grid. To build the generator, they first looked at different types of turbines, but ultimately decided to go with a reciprocating engine piston, similar to a car, which was cheaper and more readily available than the alternatives. Soon he got the attention of the U.S. Department of Energy, and received a $2 million Recovery Act award. “We didn’t invent the engine,” says Wald, “but what didn’t exist was taking natural gas at a flare location and delivering it back to the grid.”

Wald’s next challenge was convincing oil companies to adopt the device. “They’d ask, ‘have you done this before?’ No. ‘Is it proven?’ No. ‘Call us back when you have multiple sites up.’ They didn’t want a science project on their $10 million well site,” says Wald. “It’s dangerous, and gas is explosive. But then we got one, then two, then three, and then it got easier.”

Two years into the project, he almost gave up. The equipment arrived at their first test site in January 2010—in the middle of North Dakota’s brutal winter. “It’s cold as hell, the wind is blowing, and we’re out in freezing North Dakota, and we couldn’t get the generator to run on the gas. We had to pay consultants and vendors to come out, and anyone that goes out in the middle of nowhere North Dakota to troubleshoot a problem is very expensive. We spent weeks in a motel trying to get people on the phone, but we had horrible cell phone coverage. I thought, why am I doing this?”

DON’T MISS: This Solar Farm Stands for a Lot More Than Clean Energy

Wald succeeded in connecting the generators to power lines and selling electricity back to the grid. But it wasn’t economically feasible. North Dakota has some of the lowest power prices in the country, about one-third of California’s—but they were not low enough to offset the cost of implementing and maintaining the generator. And there are no government subsidies for natural gas to tap into, as there are for other forms of energy, like solar and wind. So he stopped trying to sell to the grid to power homes, and began selling directly to oil companies and the local gas plant.

Currently, most drilling rigs are powered by diesel generators, which burn through about 10 gallons of diesel an hour, adding up to some $20,000 of diesel every month. With Wald’s generators, oil companies can eliminate that bill while reducing the size of the flare. He also figured out a way to separate the heavier natural gas elements like propane and butane from the lighter ones to liquidate the gas and truck it off site to be sold on the market. Wald now has 23 generators and 11 sites, and he’s working with an engineering firm to make a more efficient liquid gas converter.

Brent Brannan, director of the oil and gas research program at the North Dakota Industrial Commission, was involved in the decision to give Blaise Energy their initial $375,000 grant. He supported Wald’s idea because while other proposals were discussing building more pipelines, Wald was looking at capturing natural gas in remote areas where pipelines may never go. “[Wald] is now figuring out ways to be more economically feasible and capture the gas more efficiently. He’s been a good partner to have for the state.” After Wald’s idea was funded, Brannan’s seen applications from a number of companies with their own ideas to solve flaring, and the field has become more competitive—an ideal situation for more innovation to occur.

“Because there is so much flaring, it’s going to take new technology, new ideas and new methods to tackle the issue,” says Wald. “Rather than complain, let’s do something about it.”

MORE: This Bizarre Bacteria Could Clean Up the Oil Business