It's incredible how much can change in just six years.

In November 2007, shares of J.C. Penney (JCPN.Q) and BlackBerry (BB -0.18%) were both trading near all-time highs, just a month removed from the S&P 500's pre-recession peak, and BlackBerry would climb even higher over the next year. 

BBRY Total Return Price Chart

BBRY Total Return Price data by YCharts

Despite the sharp recovery both companies would post after the recession -- and Penney's stock price being a strong performer as recently as early 2012 -- long-term investors are left with very little to show today. Peter Lynch said it pretty well when it comes to companies like these two:

There's no shame in losing money on a stock. Everybody does it. What is shameful is to hold on to a stock, or worse, to buy more of it when the fundamentals are deteriorating.

BBRY EPS Diluted (TTM) Chart

BBRY EPS Diluted (TTM) data by YCharts

This chart shows the numbers pretty well. Since early 2011, both companies have been losing market share, and both have been hemorrhaging money for most of the past year. But, this is just part of the story. After all, Amazon's (AMZN -1.67%) earnings chart isn't much different from BlackBerry's.

AMZN EPS Diluted (TTM) Chart

AMZN EPS Diluted (TTM) data by YCharts

But, this is where we must draw a distinction and apply context to the discussion.

The difference between losing money and investing money
Amazon's earnings-per-share has fallen off heavily over the past few years, as the company has invested heavily in growing its business. The growth is unquestionable, as the nearly 20% annual sales increases over the past half-decade show, which brings us to a great way to measure growth.

AMZN Cash from Operations (TTM) Chart

AMZN Cash from Operations (TTM) data by YCharts

While cash generated from operations is going south for both J.C. Penney and BlackBerry, Amazon is consistently generating more cash from its business operations every year, even with the quarterly seasonality of its retail business. 

What's the point?
Investors should never focus on just charts any more than they should focus on just the "story." The point is, Amazon is benefiting from (and largely driving) a major shift in the way consumers shop. J.C. Penney struggles to retain existing customers, or to attract new ones. These challenges are heavily reflected in the results of both companies. 

Once the innovator, BlackBerry failed to make the transition from a highly successful business product to a highly sought after consumer item, while Apple and Google's Android have come to dominate the smartphone space that BlackBerry, in many ways, helped create. There's a good chance that investors who initially saw the writing on the wall could have seen this coming -- at least to some extent -- two years ago, when both companies started losing market share and profits started tumbling.

Final thoughts
All companies go through growth phases, and it's important for them to be willing to sacrifice profitability in the short-term in order to grow, transition, or otherwise position the business for the future. While Amazon has been pouring resources back into the business for years, BlackBerry and J.C. Penney have been struggling in a directionless morass for so long that investors should be smart enough to stay away. 

Could there be a turnaround? Sure. But, as Lynch said, holding onto a stock -- or worse, buying more -- when the fundamentals are deteriorating is just shameful.