It was just a few years ago that P. Wesley Foster Jr. and James M. Weichert liked to go jogging together and talk business whenever the two real estate executives met at meetings and conventions.

Today, both men continue to run. Only now, they are racing against one another, with each vying to make his firm the top realty company in the Washington area.

"Weichert can outrun me" on the jogging track, Foster recently conceded. But, Foster made it clear, he thrives on competition and is doing everything he can to make sure he doesn't get beaten in the business world as well.

The rivalry between Foster and Weichert began in earnest four years ago when the New Jersey-based Weichert Realtors bought Mount Vernon Realty and opened its first office in the Washington area. But it intensified sharply 10 days ago when Weichert bought the financially troubled Prudential Preferred Properties, the area's third largest realty firm.

In the short time it has been here, Weichert -- the nation's largest independently owned real estate firm -- has gained the No. 2 spot. Locally it had 2,350 agents, 13,700 listings and $3 billion in sales last year.

Foster's Fairfax firm, Long & Foster, is the nation's second biggest independent real estate firm, behind Weichert. But locally, Long & Foster is No. 1 by any measure: 4,650 agents, almost 42,000 listings and $5.7 billion in sales last year.

Now, with the acquisition of Prudential, which had 22 offices and 850 agents in the Washington area, Weichert is hoping to garner an even larger army to battle Long & Foster.

"The name of the business is you have to have the people -- the agents -- to grow," said Peter Rucci, Weichert's executive vice president who oversees the Washington area operations.

There is only a limited amount of product, or houses, to sell, Rucci said. "You can do all the advertising in the world, but only the agents can provide the service," he said. "The more agents you have that are qualified and capable, the more sales you're going to make."

Foster knows that well. In mid-May, long before Weichert was even considering buying Prudential, Foster was actively wooing disgruntled Prudential agents, many of whom hadn't been paid their commissions for sales that had been completed weeks earlier.

Minutes after the merger was announced, Foster's team went into high gear, with several executives working past midnight talking to the top-producing Prudential agents and offering them extremely attractive financial packages to lure them to Long & Foster.

When Weichert announced his acquisition of Prudential, he told agents that they could only receive their past commissions if they signed a loyalty agreement promising to stay at the company for at least nine months. If they left Weichert, however, the agents would be unable to receive the past commissions.

Foster, however, told Prudential's top agents that he would make them whole, offering to pay their past commissions if they moved to his company; no loyalty agreement was required.

"We feel we just have to do it; we don't want those agents going to Weichert," Foster said in an interview last week. "We're out to get as many Prudential agents as we can possibly get . . . . Why? Because we want to remain No. 1."

Are Weichert executives surprised that Foster is so aggressively courting the former Prudential agents? "I would have been surprised if he didn't do something like that," Rucci said.

James Weichert declined to be interviewed. Unlike Foster, who answers his own phone and willingly gives interviews and answers queries, no matter how trivial, Weichert is elusive and shuns publicity.

"Weichert does not have a huge ego," said John Featherston, publisher of National Relocation and Real Estate magazine. "He's not concerned with having his picture on the cover of magazines; he's more concerned with having more yard signs than anyone else in the marketplace."

Both Weichert and Foster, Featherston added, "are two absolutely wonderful entrepreneurs who have seized the opportunity and marketplace over the last 15 to 20 years. Over the past several years, when other real estate companies have suffered, the two have reacted quicker than most of their competition in recognizing the downturn in the market." As a result, while others have failed, these two continue to survive, Featherston noted.

Weichert's acquisition of Prudential reflects a trend that's occurring throughout the realty business: Small firms are being gobbled up by large ones and the industry is being concentrated in fewer and fewer hands.

Yet competition is particularly fierce in Washington.

"I don't know of another market that's this competitive," said Laurie Moore-Moore, co-editor of Real Trends, a newsletter that monitors the realty business. "You now have the nation's two largest independent firms battling it out and neither one is going to want to take a back seat to the other," Moore-Moore said.

By late last week Weichert had signed up 400 Prudential agents. Long & Foster had lured away about 100, including Prudential's top agent, Marc Fleischer, and the company's top Virginia salesman, Greg Holmes.

Smaller firms also are benefiting. Pardoe/Pardoe & Graham, for instance, added 35 Prudential agents to its sales force of 300. "This has been a terrific boost for us," Pardoe President Bob Graham said.

Still, it's the contest between the two giants that is attracting the most attention from real estate executives. "Two big companies with millions of dollars are battling it out for the No. 1 position -- it's going to be like the battle between MCI and AT&T," said an executive from another company, who requested anonymity.

However, unlike the MCI-AT&T battle, the Weichert-Long & Foster duel is not expected to bring sharp pricing discounts to area homeowners who want to buy or sell a house. Leaders at both firms have made it clear they remain committed to the standard 6 percent commission fee for agents that now is included in the standard contract and have no intention to win more customers by cutting fees.

"We want to sell service," Foster said. "To give service we need to get the full commissions."

Added Weichert's Rucci: "We're not a discount broker. If it's a trade-off between price and service, we want to give more service, make it more personalized and convenient." Rucci described his firm as the Nordstrom of the realty world.

Before the competition began, Foster and Weichert were "buddies," Foster said. "I have stayed at his home and he has stayed at mine. . . . . Jim and I used to compare notes. We've backed off a little bit since we became competitors."

It's easy to understand why they became friends -- both are entrepreneurs who built their companies from scratch. Long & Foster was started in 1968; Weichert, a year later. Both have survived numerous recessions and downturns in the housing market, succeeding where many older and better-known firms have failed.

And both, as Foster noted, "are very much hands on, very much into the business" and driven by the bottom line.

Listen to the agents talk about their company presidents: "Wes sets the tones and sets the rules; that's the way things are," said a Long & Foster agent, who requested anonymity.

"Weichert is very soft-spoken and pleasant, but behind that exterior is a very focused, determined and driven businessman. There is very little input from the bottom up. You either fit into his organization and don't question things or you go to another company," said a former Weichert agent, who requested anonymity.

Foster, 61, once considered becoming a doctor until he discovered he needed to take chemistry courses as an undergraduate at Virginia Military Institute. After the Army, his first job was selling aluminum products for Kaiser Aluminum. Although his attempts to sell aluminum paneling to Washington builders failed, he did manage to find a job selling homes for a new builder.

Through that job, he met Henry A. Long and the two dreamed of selling properties all over Northern Virginia. Together the two founded the company in a small 600-square-foot office in Fairfax. His goal at the time was simply "hoping to pay the rent." Nine years later, Long & Foster had become such a local powerhouse that Merrill Lynch, seeking to buy a residential real estate company in Washington, made an offer. Long wanted to sell, but not Foster. So Foster bought out Long's share and has been running the company ever since, making a profit every year, even in recessions.

"Something I have always feared is not making money," Foster said. "I really work toward making a profit, no matter how hard times get." So in the spring of 1994, when it became clear that rising interest rates were causing a sharp drop in housing sales, Foster was quick to act. He not only made substantial cuts in his marketing staff and reduced the pay of salaried employees by 10 percent, but also trimmed the little things as well: courier service among offices and cleaning services were trimmed from daily to every other day. He also cut his salary -- to zero.

Today, Long & Foster operates in five mid-Atlantic states and the District, with 122 offices, 6,000 agents and annual sales of $8 billion in 1994. Meanwhile, Foster's goal has changed from just trying to pay rent to being the largest presence wherever the company does business.

Why is Foster so competitive? "I was born that way," he said. "The excitement of the chase is fun."

Weichert, 52, also is driven by the bottom line and, like Foster, has managed to keep his company profitable year in, year out as he grew it from a single office operation to a company that operates in seven states, from Connecticut to Virginia, with 200 offices, 7,000 agents and sales of $10.4 billion last year.

Weichert started selling real estate when he was 19, often greeting commuters off trains from New York and taking them to visit New Jersey properties.

"There's nothing more personal to me than property ownership and its rights," Weichert said nine years ago in one of the rare interviews he has given. "I want everyone to own real estate."

Much of Weichert's growth has come through acquisition. In 1991 he expanded to the Washington area by buying the assets of Mount Vernon Realty for $1.7 million after the firm was taken over by the company's major lender. Two years later he bought Shannon & Luchs.

Industry executives say it is far easier and cheaper to grow through acquisition than natural expansion. "With all the start-up costs of a new office -- renting the space, hiring the manager and agents -- it takes at least 12 to 18 months to start turning a profit, even in good markets," said David Howell, president of Mary Price Howell Properties in Falls Church. "By purchasing an office, you can get up and running and be profitable from day one."

Weichert's great game plan, said Rucci, "is to have a strong market presence from Boston through Northern Virginia."

In the Washington area that means being "the biggest at some point," Rucci said. CAPTION: James M. Weichert, left, is chasing P. Wesley Foster Jr. in a race to have the top realty company in the Washington area. Foster's firm is No. 1, but Weichert is closing fast.