The ease of shopping on the internet has created a crisis for the retail industry. Chains either need to find a compelling digital strategy in order to compete or they must find a way to get reticent customers into their stores.

That's easier said than done, but it's not impossible. Retailers may be struggling, but there are still potential winners in the space.

The three companies below are all very different, but each one offers significant opportunity for investors. Consumers may be shopping in different ways, but they are still shopping. Not all of that business will go to pure-digital plays, so it's just a question of which retailers will adapt best to the new reality.

A Wal-Mart worker

Wal-Mart has begun a major transformation. Image source: Wal-Mart.

Wal-Mart is transforming

Unlike many retailers, Wal-Mart (NYSE:WMT) was never in any real danger. The company has at points been less successful than it was, but it has remained a juggernaut, just one that has struggled with its digital strategy.

That changed in August 2016 when the company spent $3.3 billion to acquire That price may have been very steep to acquire a money-losing website, but the point of the purchase was to acquire Jet CEO Marc Lore and his management team.

Lore now runs both and and he has begun a radical transformation of how Wal-Mart approaches the internet. Instead of viewing online sales as a secondary sales channel, the company is now working to integrate its website and apps into everything it does. That means that stores will become an extension of its digital properties and vice versa.

This won't be an easy transformation and short-term margins may take a hit due to efforts like offering free shipping on any order of at least $35 in qualifying merchandise.

So far however, the results have been good. Wal-Mart saw comparable store sales rise 1.4% in Q1 and e-commerce sales spiked 63% in that period. In addition CEO Doug McMillon noted "we're moving faster to combine our digital and physical assets to make shopping simple and easy for customers," in his remarks in the earnings release.

Wal-Mart has a plan that it's executing well. It has a leader in Lore who seems to be getting the CEO's full support and the company has always had the size to be price competitive with any rival.

Dollar General is growing

In a market where many retailers are either going out of business altogether or closing stores, Dollar General (NYSE:DG) has been growing at a furious pace. After adding approximately 900 new stores in 2016, the discount chain has stepped up its game and plans to add 1,000 new stores in 2017.

Last year Dollar General grew full-year overall sales 7.9% while comparable-store sales increased 0.9%. The company expects similar results in 2017 and it has forecast a 4-6% gain in total sales with slightly positive same-store growth.

Many investors would be concerned about the lack of same-store growth, but in this case Dollar General's strength is its stability. The company has a proven model which delivers predictable sales while the chain adds new locations. The company may not predict big growth numbers, but each store it adds delivers more profit to the bottom line and the markets for expansion remain extensive.

J.C. Penney is doing it right

J.C. Penney (OTC:JCPN.Q) may seem like an unlikely player to be on this list as the department store has been struggling. It has either closed or plans to close nearly 140 stores and sales decreased slightly and comparable-store sales fell 3.5% in its most-recent quarter.

Those are bumps in the road, and the company has a tough journey ahead of it, but its CEO Marvin Ellison has a plan that it's executing well. J.C. Penney has taken steps to turn its stores into destinations by adding store-within-a-store Sephora shops, revamping its salons, and adding appliance showrooms to over half its stores. In addition the chain has moved into home services, a market once dominated by its rival Sears, a chain that has been rapidly ceding markets to J.C. Penney.

"We continue to make encouraging progress in the company's competitive and financial position despite our top-line performance during the first quarter," said Ellison in the earnings release. "...Our teams remain committed to executing on our strategic growth initiatives, and we are confident in our ability to drive sustainable growth and long-term profitability for JCPenney."

It's not going to be easy for J.C. Penney, but the company is healthier than it once was and it has a path back to viability. This stock is not the sure thing that Wal-Mart and Dollar General are, but it may offer the most upside given how far the company has fallen and how close to the edge it is.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.