These are interesting times for maternity queen Mothers Work (NASDAQ:MWRK), which just released its second-quarter earnings.

For what the company is predicting will be a difficult year, the first half certainly isn't looking too shabby. Despite the negative response from the Street, the company seemed to get things started off with a bang in the first quarter, and the second quarter followed suit. Unfortunately, investors were also consistent, knocking the stock more than 6% lower despite impressive gains in earnings.

Let's see if we can identify the reason for the lack of respect for Mothers Work. For the quarter, the company saw its earnings soar to $2.6 million, or $0.41 per share. That's well ahead of the $0.09 per share it earned a year ago and smack-dab in the middle of the guidance it provided back in January. Net sales were 0.5% lower at $143.9 million, and comps fell 1.6% in the quarter despite the advantage of an extra Saturday in this year's second quarter. I admit that's not good, but it hardly seems like enough reason to dump the stock.

Despite the slowdown in sales, the company is resisting the easy option of marking down its merchandise. Instead, it continues to improve gross margins and decrease product costs. Mothers Work continues to further reduce costs by expanding its multibrand store concepts. Rather than maintaining multiple small locations, it will improve efficiency by running fewer large stores. It has already begun to incorporate this concept in its Federated (NYSE:FD) Macy's locations by converting from Motherhood Maternity Brands to Mimi Maternity Brands, which includes both Motherhood and Mimi products. It's also looking to expand its relationship as the exclusive maternity apparel provider with Kohl's (NYSE:KSS).

Mothers Work also has plans in the works to add more features to its Futuretrust program with MasterCard (NYSE:MA), through which shoppers can save for college when they link their card to a 529 college-savings plan. In addition to reaching new agreements with financial services organizations, it plans to offer life insurance and other financial services needed by families with children.

Despite the improvements currently under way, the company expects its lackluster sales to continue, particularly for April, during which it expects comps to decrease between 11% and 15% from last April's impressive 7.1% gain. For the year, it expects net sales to be in a range of down 1% to up 1% and projects gross margin of 52.9% of net sales, which would be an increase from 52.2% in 2006. Additionally, excluding debt repurchase charges and stock compensation expense, Mothers Work expects to earn between $2.52 and $3.05 per share for the year. While that's lower than the guidance provided in January, it still represents growth of 24% to 50%.

Perhaps I'm putting too much faith in Mothers Work, but I happen to think it looks like a bargain today. It's managing its inventory smartly, earnings are strong, and it continues to generate positive free cash flow while keeping its debt well under control. Add to that its store reorganization and its agreements with department stores and the Futuretrust program, and Mothers Work looks destined to shine.

For more on the performance of Mothers Work, check out:

MasterCard is a Motley Fool Inside Value recommendation. For more on how bargains can help you beat the market, come try the newsletter free for 30 days.

Fool contributor Mike Cianciolo welcomes feedback and doesn't own any of the companies in this article. The Fool has a disclosure policy.