Source: Dollar General's annual report 

It used to be, during tougher economic times of a few years ago, that dollar stores reigned supreme. Companies like Dollar General (DG 0.96%) and Family Dollar Stores were the heroes as cash-strapped consumers latched on to competitive prices and the convenience of small-format stores. 

But the landscape has shifted since leading retailers like Wal-Mart (WMT -0.92%)and Target (TGT -0.28%) rolled out their own smaller format stores in an attempt to keep the low-income shopper from slipping away, putting pressure on the profit margins of the dollar stores.

What's a dollar store to do? Lower prices even still amid a highly promotional environment, which is precisely what Dollar General did. And the results haven't been pretty, with margins under pressure, same-store sales slipping, and shares of Dollar General and some of its peers down year to date while the S&P 500 index has been closing at record highs. But have shares of the dollar stores been beaten up too much? Based on Dollar General's 3% rally post earnings on June 3, the market is starting to think so.

Headwinds
The lion's share of Dollar General's sales over the past several years -- including three-quarters of its sales in 2013 -- have come from its lowest-margin category: consumables. Meanwhile, home products and apparel, its two highest-margin categories, have contributed less and less to the retailer's net sales. Take a look at the retailer's percentage of net sales across categories.  

 

Source Dollar General's fiscal 2013 annual report 

Now, this has translated into a shrinking profit margin. For instance, in the first quarter, which was reported on June 3, the company's gross profit as a percentage of sales was 30%, falling 57 basis points from the year-ago period. This performance follows a similarly disappointing decline in the fourth quarter, when the company's gross profit as a percentage of sales sank 58 basis points year over year to 31.9% from 32.5%.  

Dollar General managed to generate a 3.3% increase in same-store sales in fiscal 2013, continuing a trend of positive same-store sales for the retailer. And in light of the a same-store sales decline at Wal-Mart, Dollar General's performance practically shines. Compared with past performance, however, Dollar General' same-store sales are far less compelling. The company's same-store sales growth has been steadily slowing since fiscal 2009, when it generated a 9.5% increase in this metric. Meanwhile, Dollar General has seen the price for the average basket fall between 3% and 4% over the past year, according to Sterne Agee analysts cited in The Wall Street Journal.

Competitive landscape
And the dollar stores continue to face an increasingly competitive environment, with Wal-Mart recently having doubled its planned expansion of smaller-format stores to as many as 300 new stores this fiscal year and Target pushing its TargetExpress concept.  As they do, lower-income consumers, the dollar stores' core consumer base, will be faced with even more choices, potentially putting even more pressure on dollar stores' sales and profits. And when it comes to the low-income shopper, if the dollar stores' grip on this demographic weakens, they've got more to lose than their big-box discount retailer counterparts. 

Source: The Wall Street Journal and Prosper Insights & Analytics

Nearly 40% of the households that shop at Dollar General earn less than $25,000 per year. That percentage is even greater at Dollar Tree, where closer to half of its customers come from households that fall below that same income threshold. These households comprise a much smaller portion of both Wal-Mart's and Target's customers, at approximately 20% and 15%, respectively. But Dollar General has expansion plans of its own, with expectations for another 700 new stores this year and more prominent brand names on its shelves. 

Good enough?
So with all this margin pressure surrounding Dollar General, why did shares rally in response to earnings? First-quarter performance was pretty much in line with expectations, and the retailer experienced strong sales momentum in April which it says is continuing so far in the current quarter. Plus Dollar General maintained its full-year guidance. Profit margin pressure notwithstanding, Dollar General is calling for 3% to 4% same-store sales growth for fiscal 2014, which is on par with expectations for the retail industry this year. 

Foolish conclusion
So was the 3% gain in Dollar General shares a harbinger of things to come or more in the way of a relief rally because things weren't worse than expected? Quite possibly a little of both. 

Dollar General management appears much more sanguine about the retailer's outlook now than they have for months. And to be clear so do investors. The retailer is rolling out some new products in the $1 to $5 range, and some of those lower-priced items will carry higher margins. So there could be margin improvement going forward.

Nonetheless, there are still plenty of headwinds for this retailer to overcome, not the least of which originate from the growing presence of its larger rivals' express stores. For every challenge, there's a matching opportunity, as dollar store rival Family Dollar is closing some stores, which gives Dollar General a chance to snag more market share. If the retailer can stem the decline in its gross margin and compete in this environment, there could be more upside ahead. It's just a little early still to tell.