Retail stores have taken a beating during the recent recession, as consumers dug their heels in and tried to weather the economic storm by making as few purchases as they could. Though not out of the woods by a long shot, some retailers are starting to see a bit more customer activity. Target (NYSE: TGT) beat analysts' projections by $0.10, reporting higher sales and a better outlook for 2012, while Macy's (NYSE: M) fourth-quarter results showed an increase in earnings of 12% over this time last year, as well as increased sales of nearly 6%. Now we have Costco (Nasdaq: COST), rushing its stellar February numbers to press ahead of anyone else.

Costco has reason to be proud: Its same-store sales increased 8%, overall sales rose 10%, and profit soared 13%. Competitor Wal-Mart (NYSE: WMT), whose Sam's Club stores are much like Costco's, reported disappointing fourth-quarter numbers, even despite small gains by Sam's Club. What is Costco's secret?

Costco's efforts to lure shoppers pay off
The big-box retailer has many tricks up its enormous sleeve, all of which seem to have played a part in its success. First and foremost, Costco, unlike Wal-Mart, was able to increase its foot traffic with price-cutting measures without harming its bottom line. Some experts bemoaned the company's slightly shrinking gross margin, however, which they felt was reflected in the constrained share price gains following Costco's announcement. The sale of discounted gasoline is a contributing factor to this, a tactic that the retailer uses to draw shoppers to its stores. It's hard to argue that sizable uptick in same-store and overall sales, though.

A gutsy move on Costco's part was increasing its membership fee, a maneuver that might have alienated shoppers. Instituted late last year, the 10% hike seems to have paid off, with no decrease in foot traffic and sales. The company credits the fee increase for a nearly 8% rise in fee revenue.

One of Costco's main strengths, in my opinion, is its popularity with shoppers. Consumer Reports magazine reported the results of a shopping survey in its March issue, which rated Costco No. 1 out of 10 well-known retailers. Although the sample was rather small -- 26,000 respondents -- the chain performed extremely well in the categories of quality, value, and layout. Although the poll results may not be the numbers that investors are most interested in, the loyalty of Costco's customer base may very well be reflected in its fourth-quarter report card.

My take
Despite some analysts' reservations about Costco's low prices affecting profit margins, the retailer definitely seems to be on the right track. Surely Costco noticed the squeeze, which probably prompted the fee hike, giving the retailer something of a buffer. While gasoline is not going to make Costco's fortune, rising fuel prices will very likely attract even more shoppers to Costco, and will aid the retailer's bottom line over time. Also, as the Consumer Reports survey and the muted reaction to the fee increase indicate, Costco seems to have a loyal customer base who will surely appreciate the discount in fuel prices. If it stays on its current course, it's only a matter of time until the market loves Costco as much as its shoppers apparently do.

The Costco model could be the wave of the future, a good basis for a smart investment. Find out how this new format is changing the retail landscape by ordering our free report "The Motley Fool's Top Stock for 2012."

Fool contributor Amanda Alix owns no shares in the companies mentioned above.

The Motley Fool owns shares of Wal-Mart Stores and Costco Wholesale. Motley Fool newsletter services have recommended buying shares of Wal-Mart Stores and Costco Wholesale. Motley Fool newsletter services have recommended creating a diagonal call position in Wal-Mart Stores. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.