Stock metrics are a lot like baseball statistics. There's a seemingly endless variety of them, and each investor has a specific favorite.

Yet regardless of how one prioritizes them, there are a handful of metrics that always end up at or near the top. There's the price-to-earnings ratio for investors interested in valuation. There's the debt-to-equity ratio for those concerned about solvency. And there's the current ratio, which offers a quick and dirty assessment of liquidity.

For investors principally concerned with profitability in the retail space, however, the holy grail of statistics is the gross margin -- the percent of profit retained from each dollar of sales after deducting all sales-related expenses, also known as the cost of goods sold. And an added benefit of this metric, is that its explanatory power isn't limited strictly to profitability, as it also serves as an estimate of pricing and brand power.

Bigger is generally better
As a general rule, the bigger a particular company's gross margin is, the better. The poster child of this is Apple (Nasdaq: AAPL). In the last five years alone, its gross margin has increased from 34% in 2007 to over 42% today.

This increase has trickled down its income statement, making Apple one of the largest and most profitable companies in the world. It recently passed energy giant ExxonMobil to assume the mantle of largest publically traded company in terms of market capitalization. And on a per share basis, it's the third most profitable company in the United States, behind only Berkshire Hathaway and Seaboard Corporation.

The success of clothing retailer lululemon athletica (Nasdaq: LULU) speaks similarly to the virtues of monster gross margins. And arguably more so than Apple, as its 2011 gross margin came in at an astounding 55.5%. Speaking very generally, this means that more than half of every dollar of last year's revenue made its way to the company's claimholders -- be they corporate employees and executives, creditors, or shareholders. In terms of the latter group, this translated into a 30% increase in the price of the company's shares.

When bigger isn't better
Before drawing too clear a line with respect to the size of gross margin, it's important to recognize that there are exceptions to the bigger is better rule. And membership-based retailer Costco (Nasdaq: COST) is one.

If one were to compare Costco's 12.6% gross margin to, say, Lululemon's, it'd be easy to conclude that the latter is a vastly superior investment to the former. Yet it's this very fact -- i.e., low margins -- that paved the way for warehouse retailer's wild success. Indeed, people go to Costco and pay its membership fees for the very reason that it keeps its margins low and thus its products ultracompetitive.

The same thing can be said for a company like Wal-Mart (NYSE: WMT), which sports an otherwise paltry 25% gross margin. Yet few people would argue with its success throughout the years -- not to mention, its investment returns. Warren Buffett even claims that not investing in the retail giant was the costliest investing mistake of his life.

It's growth the matters
If size alone isn't an indication of the quality of a retailer's gross margin, then what is? Growth. In other words, you want to see the size of a company's gross margin increase rather than decrease with time.

On the face of it, for example, Barnes & Noble's (NYSE: BKS) 2011 gross margin of 25.6% doesn't seem bad when you consider it was more than double Costco's. The problem is that the beleaguered bookseller's gross margin used to be over 30%. In the face of intense competition from the likes of Amazon.com, however, it has had to decrease prices to compete. Needless to say, this isn't something you want to see from a company you're invested in, as it means that your piece of the pie would gradually decline over time.

Foolish bottom line
At the end of the day, whether you invest in the retail sector or others, getting your head around gross margin will help you become a better investor. And in doing so, it's important to remember that stocks, like most things, operate in shades of grey. As a result, you always want to consider both the size and trend in a specific company's figures.

If you like investing in retail stocks and want to discover the identity of the retail superstar that some are calling the next "Costco of Latin America," click to access our free report: "The Motley Fool's Top Stock for 2012."