Recent rallies notwithstanding, the stock market has been in a bit of a slump for a while now. That doesn't mean that bargains abound. Far from it. But, with a little digging and exploring, you may find some solid companies trading at attractive prices. I think I just did -- two.

They're competitors, and both are trading at reasonable, if not attractive prices. Meet Automatic Data Processing (NYSE:ADP) and Paychex (NASDAQ:PAYX), America's No. 1 and No. 2 payroll-services outsourcers. If you've been around the investing block a few times, odds are you've heard of them. Even if you haven't, there's a good chance that they've been serving you for years without your even noticing it (just peer closely at your paycheck). Better still, while they're making big money for themselves, they might make some for you, too. You might end up earning paychecks from paychecks.

Here's how the companies describe themselves:

"Paychex is a leading national provider of payroll, human resource, and benefits services for small- to medium-sized businesses, those with fewer than 200 employees. Paychex is based in Rochester, NY, and today has more than 100 locations around the country, serving hundreds of thousands of clients nationwide. In fiscal 2003, Paychex exceeded the billion-dollar mark in revenues for the first time since the company went public in 1983, generating nearly $1.1 billion in service revenues."

"[ADP is] the Business Behind Business. Providing paychecks for approximately 30 million workers worldwide, processing securities transactions for clients on five continents, delivering computing solutions to more than 16,000 auto/truck dealers, and serving more than 20,000 clients in the property and casualty insurance industry." ADP's revenues clock in at around a whopping $7 billion annually.

Big and bigger
ADP is the 54-year-old granddaddy of the payroll business. Paychex is a bit of an upstart, though it's 32 years old itself. ADP serves 450,000 employers in 26 countries, cutting paychecks for some 30 million workers worldwide. It also provides services like tax advising, human resource consulting, brokerage trade processing, insurance claim processing, and automotive dealership management systems.

Paychex is no slouch, either, with some 490,000 clients of its own -- though these tend to be much smaller companies, as 80% of Paychex clients have fewer than 20 employees and 36% have fewer than five. Paychex also offers services related to tax payments, benefits administration, retirement services featuring 401(k) plans, workers' compensation, and more.

What's so attractive about these businesses, exactly? Well, think about it. High switching costs make for protective moats around both. Once you sign up with one of these firms and get them processing your payroll (or perhaps providing some of the other services they offer), you're rather unlikely to switch to another provider. Inertia is one reason, but common sense is another -- switching would be a headache. And once you've got customers locked in via high switching costs, you're more able to hike your prices over time, as they're not likely to bolt at the slightest increase.

Profitability is a second advantage. These are not the most expensive businesses to run. Once they've got their systems up and running, it just doesn't cost that much more to tack on additional customers. They don't have to keep building new restaurants or stores, or buy more rubber to make more tires to boost sales.

Growth prospects are another. As Paychex notes in a presentation, outsourcing payroll services makes a lot of sense for smaller companies because it means they don't have to stay on top of hundreds of tax law changes and be at risk of penalties for non-compliance. They can instead trust the pros to take care of their needs. Paychex also estimates that only 15% to 20% of its target market is outsourcing payroll -- in other words, there's lots of room for growth.

Here, drawing from data at the Fool's Quotes and Data area (which is free) and Hoover's Online (which costs a little), are some key numbers for the two companies:

    ADP             Paychex
    Annual sales          $7 billion      $1 billionMarket cap.             $22 billion     $11 billionGross profit mgn.        58%                82%Net profit mgn.          15%                28%Return on equity         21%                28%Return on assets          5%                 8%ROIC                     21%                28%P/E ratio                 21                 3810-yr. P/E range       19-49              21-90Price-to-cash flow        17                 28Total debt/equity       0.02               0.00Cash flow/share        $2.29              $0.933-yr. rev. growth       4.6%              12.5%3-yr. EPS growth       11.2%              14.4%Dividend yield          1.3%               1.5%Payout ratio            0.27               0.57

[The best way to really get a handle on a company's financials is to review the financial statements and crunch the numbers yourself. If you'd like to learn how to do this, we can help, via our "Crack the Code" How-to Guide (otherwise known as an online seminar).]

It all checks out
These numbers are rather impressive. Some of ADP's might pale next to Paychex's, but understand that they're still extremely solid. Some, like ADP's net profit margin, have increased steadily over the past decade. (Paychex's net profit margin has nearly tripled in that span.) Paychex might be growing faster, but it also sports a steeper valuation. ADP remains a powerhouse, and has, among other things, more flexibility to increase its dividend, as it only pays out 27% of its earnings vs. Paychex's 57%. Both firms are trading near the low end of their 10-year P/E range.

Why? Well, a sluggish economy is partly to blame. In ADP's case, some of its revenue stems from processing brokerage trades. But as you might imagine, there's a lot less trading going on than there was in the late 1990s. Meanwhile, with Paychex focused mainly on smaller companies, it's arguably suffering from a reduction in new startups. With the go-go '90s behind us, exuberant new companies are not popping up like wildfire, demanding outsourced payroll services.

Of course, as the economy improves, as undoubtedly it will one of these days, it will boost the fortunes of ADP and Paychex. New firms will emerge, existing firms will hire more people who need paychecks and other services. Stock trading will increase, too.

This is a good time to give these two companies a close look to see if there's a spot for either in your portfolio.

See what others are saying about these firms (and share your own thoughts) on our ADP and Paychex discussion boards -- and if you're not already a part of our vibrant discussion board community, take advantage of a painless free trial to see what all the fuss is about.

And finally, if you'd like to receive more stock investment ideas, with even more research behind them, check out our newsletters -- Tom Gardner's The Motley Fool Hidden Gems and The Motley Fool Stock Advisor -- which are getting rave reviews and offer several stock picks each month.

Selena Maranjian has lived life with paychecks and life without. She prefers life with paychecks. For more about Selena, view her bio and her profile. You might also be interested in these books she has written or co-written: The Motley Fool Money Guide and The Motley Fool Investment Guide for Teens . The Motley Fool is Fools writing for Fools.