Costco (NASDAQ:COST) delivered an unpleasant surprise today when it warned its fiscal fourth-quarter earnings will come in "well below" the consensus estimates, although it also delivered a consolation prize in the form of a $1 billion increase in its share buyback program.

Analysts had expected fourth-quarter earnings of $1.00 per share, but apparently that's just not happening. (And the amorphous "well below" isn't exactly a confidence builder, of course, although in its conference call, it said many of the elements at work are still variable.) If you thought inflation was hurting you, it's hurting Costco, too. It mentioned a greater-than-expected inventories charge related to its last-in, first-out (LIFO) accounting.

Beyond that, Costco's issues sound familiar: its gasoline operations will swing to the negative side and it's experiencing lower merchandise margins as it fights to keep its prices down to not only help drive sales but also to maintain its members' "confidence." The high price of energy has been hitting Costco on many aspects of its business, too, including freight costs as well as the direct price of merchandise.

The last thing Costco would want is for its members to think they're not getting good deals in these difficult times. Strategically, that's smart, but obviously many investors took the news pretty hard today, sending the stock down by about 10%. After all, Costco's recently heady earnings and fired-up comps do make this seem like a rather nasty surprise.

However, Costco and its discount rivals Wal-Mart (NYSE:WMT) and Target (NYSE:TGT) still seem well positioned to do well in these current times, as the same inflation drives their target demographic to look for good deals. If Costco's taking a short-term hit in trying to make things as cheap as possible for its members, that's a solid long-term strategy. Nobody wants to look like they're gouging right now, especially if the brand relies on bargain merchandise.

And of course, maybe the really difficult road lies ahead for luxury department store retailers like Nordstrom (NYSE:JWN) and Saks (NYSE:SKS), which have had a harder time coaxing skittish shoppers to buy at higher price points.

Costco is a great company with excellent management, and it's been doing well in these difficult times. Last quarter I found myself thinking a temporary setback would make Costco's stock price look a little more appealing; it looks like opportunity's starting to knock.   

Pick up some related Foolishness: