Shares of Barnes & Noble (BKS) have been on a roller-coaster ride in 2014, but for the most part it's been a good year for investors. As recently as early February, Barnes & Noble stock was worth just $13, but it has since recovered to more than $23.

BKS Chart

Barnes & Noble 1-Year Stock Chart, data by YCharts.

Better-than-feared holiday sales results supported Barnes & Noble stock, and the company's recent decision to spin off its Nook Media subsidiary spurred further gains.

However, the party may be almost over for Barnes & Noble investors. Pretty much all of its business lines appear to be in decline, and sooner or later competition from Amazon.com (AMZN 0.79%) will likely kill off the bookseller. At its current price, the risk/reward trade-off for Barnes & Noble stock does not look favorable.

Declining sales across the board
Competition from Amazon has taken its toll on Barnes & Noble recently. Revenue declined 6.7% in fiscal 2014, despite there being an additional week in the budgetary calendar. Core comparable-store sales for the retail segment (a measure that excludes Nook e-reader/tablet sales) were down 3.1% for the full year.

The retail segment's declining sales trend is not surprising. The shift of retail sales toward e-commerce and declining sales of physical media (as opposed to digital media) make Barnes & Noble's core retail store business less relevant.

Amazon's Kindle ecosystem has been far more successful than Barnes & Noble's Nook.

More troubling are Barnes & Noble's troubles in the digital world. First, online sales declined year over year in fiscal 2014. Second, Nook digital content sales plummeted more than 20% over the same time period. These should be growth businesses, so the poor results are a big red flag for investors in Barnes & Noble stock.

Meanwhile, Amazon's strategy of selling Kindle tablets and e-readers at or below cost is finally starting to deliver tangible benefits. Amazon's North American media sales growth began to accelerate last fall.

Can Barnes & Noble be fixed?
Barnes & Noble bulls would argue that Nook content sales are being hurt by low sales of Nook tablets -- the result of the company's decision to cut costs by not releasing a new model last year. The company's recently announced partnership with Samsung to build a co-branded tablet could help reinvigorate sales. Barnes & Noble is also redesigning its website to boost online sales.

However, neither of these moves seem promising enough to justify investing in this stock. On the Nook side of the business, Barnes & Noble has simply fallen too far behind Amazon's Kindle ecosystem. Given Amazon's willingness to sell hardware at or below breakeven, Barnes & Noble won't be able to catch up at any acceptable cost.

Barnes & Noble's Nook device sales have been weak recently.

As for online sales, Amazon's large and growing base of Prime subscribers is akin to a captive market of big spenders. Barnes & Noble has its own membership program that offers similar shipping benefits, but the much wider utility of Amazon Prime makes it more attractive despite being pricier. People who sign up for Prime are likely to do the vast majority of their online shopping with Amazon.

Squeezing out cash
Barnes & Noble's core business of selling books in bookstores is declining and its digital businesses are not picking up the slack. As a result, owning Barnes & Noble stock is essentially a bet that the company can squeeze out enough cash to justify the current share price before Amazon drives it out of the market.

The Nook Media division that is being spun off -- which includes the Nook business as well as Barnes & Noble's college bookstores -- is losing money and is likely several years from turning a profit. While it was once valued at $1.8 billion, the rapid drop-off in Nook device and content sales since 2012 means it is probably worth a fraction of that amount today.

Barnes & Noble's retail stores still generate the bulk of its cash flow.

The retail division is the real cash cow. Last year, it generated earnings before interest, taxes, depreciation, and amortization of $354 million. Subtracting $65 million in retail division capital expenditures, assuming minimal interest expense, and estimating annual taxes at $80 million to $90 million implies that Barnes & Noble's retail division produces roughly $200 million of annual free cash flow today.

If that level of cash flow were likely to continue going forward, Barnes & Noble stock would be enticing. However, EBITDA fell by $22 million last year and could continue declining at that rate or faster due to the ongoing pressure from Amazon.com. As a result, Barnes & Noble's cash flow could disappear very quickly in the next five to 10 years.

Foolish final thoughts
Barnes & Noble stock has rallied recently, thanks to the Samsung tablet partnership and the planned retail/Nook Media separation. However, the retail business is still in steady decline, while the Nook business is speculative at best, never having been reliably profitable. Thus, while Barnes & Noble stock seemed appealing at $17, it does not look like a great bet anymore.

Investors who are still intrigued by Barnes & Noble may want to wait for more information about the separation of the retail and Nook Media businesses. The structure of the separation agreement will impact the value of each piece of the business, potentially creating a better investment opportunity later on.