Data source: Getty Images.

The landscape of retail has changed dramatically in the past decade. Whereas malls throughout America were once teeming with shoppers, many of those customers have migrated online. E-commerce is the name of the game now, and nowhere is that more apparent than in the investment returns of the new guard -- for example, Amazon.com (AMZN 1.16%) -- versus those of the old guard -- such as J.C. Penney (JCPN.Q)

JCP Chart

JCP data by YCharts

But while it's easy to look back and say, "Clearly Amazon was the better choice in 2006," it's another thing entirely to look forward and make a similar claim about how the two stock will perform from here. With J.C. Penney shares down so much, many might think that it's a better stock to buy today.

While there's no perfect way to answer which stock is the better buy, here are three detailed lenses through which the question can be approached.

Financial fortitude

As unexciting as it is, companies that have money in the bank have options. If tough economic times hit -- or businesses make major missteps -- cash is king. A strong balance sheet allows them them to  outspend their rivals, buy back shares on the cheap, or even acquire competitors.

Debt-heavy companies often have to take the opposite approach -- focusing only on weathering the storm. Here's how these two stack up in terms of financial fortitude.

Company

Cash

Debt

Net Income

Free Cash Flow

J.C. Penney

$429 million

$4.76 billion

($370 million)

$77 million

Amazon

$16.5 billion

$17.9 billion

$1.9 billion

$6.7 billion

Data source: Yahoo! Finance. Net income and FCF are on trailing twelve-month basis.

It should be noted that Amazon is valued at about 145 times the size of J.C. Penney. But even after taking that into account, it's clear that Amazon is in better shape. While it's great to see that Penney's is once again free cash flow (FCF) positive, the ailing brick-and-mortar retailer still has 11 times more debt than cash.

The same cannot be said of Amazon, which has been generating a lot of FCF lately -- thanks in large part to the success of Amazon Web Services (AWS).

Winner = Amazon

Sustainable competitive advantages

In investing circles, sustainable competitive advantages are often referred to as "moats." A company without a moat will eventually see its profits disappear into thin air as competitors invade its territory, and offer comparable products at a lower price point.

Historically speaking, J.C. Penney's moat was provided by the sheer number of its locations nationwide, and the strength of the company's brand. That moat, however, has become more of a liability as e-commerce has expanded.

Amazon, on the other hand, has two key attributes providing its moat. The first is its worldwide network of fulfillment centers. Currently, it is estimated  that there are 80 such centers domestically, with plans for 22 more. These centers help ensure that customers get the products they order in two days or less, and it would cost billions for a competitor to try and match this scale.

The second moat is provided by the popularity of Amazon's Prime subscription service. While there are a host of benefits associated with Prime, the most important in customers' minds is free two-day shipping. While the company doesn't release hard numbers, it is estimated that there are 63 million Prime members. If we assume that a household need not have two memberships, this is equivalent to roughly half of America. That's simply astounding!

Winner = Amazon

Valuation

Finally, we have to determine how expensive each of these stocks are. Here are four of my favorite metrics for this measurement.

Company

P/E

P/FCF

P/S

PEG Ratio

J.C. Penney

N/A

36

0.2

N/A

Amazon

210

60

3.3

4.2

Data source: Yahoo! Finance, E*Trade, NASDAQ. P/E determined using non-GAAP EPS.

It is in this final area that investors usually have the biggest problem with Amazon. Because the company is famous for reinvesting most of its revenues into future growth initiatives, profitability is very low, which leads to a sky-high P/E ratio.

At the same time, J.C. Penney has its own problems; it has failed to earn an annual profit for four years running. And it still has to find a strategy that can consistently woo shoppers back to its locations. Overall, it's tough to call either of these stocks a great deal based on valuation.

Winner = Tie

So there you have it: Amazon is clearly the better pick, but I would understand if you're wary about buying shares since the stock is so expensive. If you truly want to be an Amazon shareholder, I would suggest making a small purchase now, then following up by adding at better value points over time.