No matter how great your strategic plan or how motivated your employees, there will always be elements of your business you can't control. Bad weather, a flu scare or some other unexpected catastrophe -- like, say, a global financial crisis -- can batter you at any time.

Companies of every size are currently being dragged down by larger market forces. But this week, two of the country's largest retailers showed it's possible to stay hopeful for the future while accepting a less-than-ideal reality. And that's the kind of attitude that keeps a company around for the long haul, whether it's got seven employees or 70,000.

Image placeholder title

Home Depot

(HD) - Get Report

and

Lowe's

(LOW) - Get Report

, the country's largest home-improvement chains, each reported first-quarter earnings this week, reports that were widely anticipated as bellwethers for the larger housing market. If sales of lumber and kitchen cabinets go up, it might signal that Americans are starting to spend again.

Unfortunately, the news wasn't great. Sales were down at both retailers, as were earnings. At Home Depot, sales fell almost 10% from a year earlier, with same-store sales also dropping 10%. At Lowe's, sales dropped 1.5%, with same-store sales declining 6%.

That comparatively lower sales decline from Lowe's was enough to give the market a slight boost. Daniel Binder, managing director at securities firm Jefferies, says Home Depot's comparatively worse performance may be mostly a matter of geography. "Home Depot has more exposure to hard-hit housing states," he says. "Home Depot has 23% of its stores in California, Florida, Arizona and Nevada, while Lowe's has 15%."

The upshot is that neither company will be leading us out of a recession anytime soon. But lurking under all that red ink are indications that both companies are staying true to their long-term goals. Despite the fact that they've lost money and customers over the past two years, they're focused on what they

can

control: how to improve their businesses no matter what the economic climate.

For Lowe's, the challenge is to escape the role of perennial runner-up. Lowe's currently operates 1,670 stores in the U.S. and Canada (compared with 2,200 for Home Depot), and it's determined to close the gap with its larger rival.

So, despite the bleak outlook for retailers, Lowe's opened 21 new stores in the first quarter. That pace may be slower than execs planned a few years ago, but it's still impressive given the current state of customer spending.

Home Depot, on the other hand, is battling for its reputation. Over the past decade or so, the company's customer-service rankings slid, due in part to cost-cutting initiatives by former Chief Executive Robert Nardelli (he of the $200 million severance package).

Current CEO Frank Blake knows that repairing Home Depot's image is one of the top projects on his to-do list, highlighting the issue in the company's earnings report. "Our markets, and the consumer in general, remain under pressure," he said in a statement. "But we continue to make progress on improving our business as evidenced by stronger customer satisfaction ratings."

"They're focused on fixing what they have," says Binder, "which includes everything from merchandising, systems, distribution, store experience and customer service, to name a few."

Until the larger business climate changes, both Home Depot and Lowe's will be at the mercy of economic forces beyond their control. Lowe's can only expand so much, and Home Depot has found that better service isn't enough to bring in waves of new shoppers. Although both chains have seen an uptick in sales of outdoor-related products as the weather warms up, their outlooks remain cautious for the rest of this year.

But being cautious doesn't mean refusing to move forward. By keeping their larger goals in mind, both companies are doing the best they can with weak hands. But the ultimate payoff may be worth it: a far stronger company in the years ahead.

Elizabeth Blackwell is a freelance writer based in Chicago. She is the author of Frommer's Chicago guidebook, and writes for the Wall Street Journal, Chicago, and other national magazines.