Nobody ever complains about vegetables being too fresh. Not shoppers, who increasingly seek out high-quality, locally sourced produce, and certainly not grocers, for whom freshness means longer shelf life and less waste. What both cohorts do grouse about is the cost and difficulty of getting the freshest possible food. Volume distributors are rarely right across town, and every highway a shipment of tomatoes has to traverse on its way to market brings it closer to spoilage. In an industry that loses an average of 6% of its produce to waste, cutting distance can directly boost dollars.

Paul Lightfoot wants to help grocers eliminate distance. His company, BrightFarms, has deals with more than a half-dozen chains to build and manage hydroponic greenhouses on store rooftops, parking garages, and empty lots. There, farmers trained by BrightFarms will grow tomatoes, lettuce, and a mix of herbs—which can be delivered directly to shelves after harvesting.

Grocery stores pay nothing to build greenhouses on their roofs.

The partnerships provide the freshest possible produce, as well as consistency in pricing. Stores constantly struggle to respond to market volatility: A drought in California can make the cost of lettuce jump overnight, while a freeze in Florida can send tomato prices soaring. "To make the same amount of money, you have to be on your toes about when to adjust prices," says Christian Haub, who served as chairman of the board of A&P and is now a senior adviser to BrightFarms. "And you have to persuade consumers, who have no idea there is a supply issue in California, you're doing it for a good reason."

What sets BrightFarms apart from other urban-farming enterprises is its business model. Lightfoot, 42, spent a decade developing retail software before joining BrightFarms in 2011. "I'm a business supply-chain guy," he explains. "I just happen to also care about the environment, so I spent years looking for something I could make money on."

Lightfoot's innovative arrangement allows grocery stores to pay nothing to build the farms. Instead, they sign a 10-year contract to purchase their lettuce, tomatoes, and herbs from BrightFarms, with a guarantee that prices will never exceed average inflation. According to BrightFarms's projections, if future price increases mimic historical patterns, its produce will cost a fraction of market rate by 2030. In an industry where margins average just 1% to 2% per year, those savings would have a significant impact on grocers' profits.

That promise of a boosted bottom line attracted Oklahoma City-based grocer Homeland, which signed a deal to put a 40,000-square-foot farm atop a parking lot adjacent to one of its 76 stores. BrightFarms also won over McCaffrey's, an upscale New Jersey chainlet; has letters of intent with 13 other retailers; and will be building a 100,000-square-foot farm in Brooklyn, New York, that will grow up to a million pounds of produce each year. That's a lot of highway miles cut out of the vegetable procurement process. "Our banner is 'a fresh experience,' " says Homeland CEO Darryl Fitzgerald. "And it doesn't get any fresher than growing it next door."