Best Buy (NYSE:BBY) shares sank more than 4% last Wednesday as investors digested the company's fourth-quarter earnings report. While Best Buy's earnings came in ahead of expectations, comparable-store sales declined. Moreover, the company offered fairly weak guidance for the current quarter.

It took just one day for Best Buy stock to bounce back, though. Shares of the consumer-electronics giant soared last Thursday, after struggling rival hhgregg (NASDAQOTH:HGGGQ) announced plans to shutter 40% of its store base.

Is Best Buy stock likely to make further gains thanks to competitors' problems? Or will it be dragged down by the same powerful forces? Let's take a look.

The Best Buy logo

Will Best Buy soar or sink? Image source: Best Buy.

An earnings beat -- and weak guidance

Best Buy's revenue slipped 1% year over year in the fourth quarter, driven by a 0.9% decline in domestic comparable-store sales. However, comp sales in the much smaller international segment rose modestly. Furthermore, margin improved across the board because of pricing improvements, a better mix of product categories, and solid cost control.

That improvement led to a big jump in Best Buy's earnings per share. Adjusted EPS surged 27% year over year to $1.95 in Q4, sailing past the average analyst estimate of $1.67.

Best Buy's fourth-quarter performance was roughly in line with its full-year trend. For fiscal 2017, adjusted EPS jumped 28% to $3.56. In fact, Best Buy's earnings came in well ahead of analysts' estimates in every quarter of the year.

The strong earnings report didn't help Best Buy stock gain altitude. Instead, investors zeroed in on the company's sales declines and its downbeat guidance. For the current quarter, Best Buy expects adjusted EPS of $0.35-$0.40, down from $0.44 a year earlier, driven by a comp-sales decline of 1%-2%. Management blamed the weak outlook -- as well as last quarter's sales decline -- on "unprecedented product availability constraints."

The full-year outlook is only modestly better. Excluding the impact of having a 53rd week in fiscal 2018, management expects revenue and operating income to be roughly flat with last year.

Competitors are in even worse shape

The front of an hhgregg store

hhgregg filed for bankruptcy protection on Monday. Image source: hhgregg.

The good news for Best Buy is that the same industry conditions hurting its revenue growth are wreaking havoc on competitors. This week, hhgregg confirmed the inevitable, filing for Chapter 11 bankruptcy protection.  hhgregg will close 88 of its 220 stores by mid-April while it moves through the restructuring process.

As of now, hhgregg generates about $1.7 billion of annual revenue. Its store closures are likely to put hundreds of millions of dollars of annual sales up for grabs. If its reorganization plan ultimately fails, Best Buy may be able to poach more sales in future years.

RadioShack is also on the verge of declaring bankruptcy -- again -- according to The Wall Street Journal. While RadioShack hopes to keep operating most of its remaining stores, its dreadful results in recent years cast doubt on its long-term viability.

Best Buy stock still has some upside

I've been a Best Buy skeptic for several years. However, the company's recent EPS rebound and the steady disappearance of its brick-and-mortar competitors together suggest that Best Buy has insulated itself from some of the weak trends affecting the consumer-electronics industry as a whole. As a result, I think Best Buy stock has some upside left.

My Foolish colleague Rick Munarriz correctly noted that liquidation sales at rivals like hhgregg could steal some business from Best Buy. However, that's a short-term problem that will be confined primarily to Q1. By mid-April, hhgregg will be a much smaller chain, making Best Buy's life somewhat easier.

Furthermore, product availability should improve as the year goes on. The launch of a new "iconic" iPhone this fall is another potential lever for driving a return to sales growth.

Lastly, a stepped-up capital return program could boost Best Buy stock. In conjunction with its recent earnings report, Best Buy raised its dividend by 21%, bringing its yield to about 3%, and announced a new plan to buy back $3 billion of stock over the next two years. That would enable Best Buy to retire more than 20% of its outstanding shares.

Given that Best Buy has nearly $4 billion of cash and investments on its balance sheet -- which is probably twice as much as it needs -- and generated $2.6 billion of free cash flow over the past two years, this capital-return program could be increased further next year.

Best Buy stock certainly isn't a screaming buy. It continues to face significant risk related to the steady shift in consumer buying habits toward e-commerce. However, with an enterprise value of just $11.2 billion and annual free cash flow well above $1 billion, Best Buy stock may have more room to run in 2017. 

Adam Levine-Weinberg has no position in any stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.