R.H. Macy & Co., the legendary New York retailer, emerged yesterday with a surprise $6.53 billion bid for Federated Department Stores.

The move threw Toronto developer Campeau Corp., which has been pursuing Federated for weeks, into a frenzy of activity to devise a countermove.

A purchase by Macy's would pair two of the nation's premier merchants. It would also quickly give Macy's a long-sought critical mass in Southern California -- in the form of Federated's upscale Bullock's chain of department stores.

Macy's is the nation's largest department store chain, with about 100 locations, including 33 in northern and central California.

The unexpected entry of Macy's into the Federated sweepstakes also appeared to mean another delay in a decision about the sale of Ralphs Grocery, the 129-store supermarket chain based in Compton, Calif. Ralphs, which is regarded as a likely candidate for sale no matter who buys its parent company, is expected to bring $1 billion.

Macy's sudden appearance on the scene stunned many Wall Street analysts and arbitragers, who had expected Federated and Campeau to hammer out final details of a deal that they had foreshadowed in a statement Friday.

Under the Macy's offer, announced late yesterday by Federated, shareholders would receive $73.80 a share in cash for about 80 percent of Federated's 88.5 million outstanding common shares. The rest of the Federated shares would be exchanged for a 40 percent share of the newly formed company.

The combined company would seek a listing on the New York Stock Exchange, marking Macy's return to public ownership after being privately held since July 1986. Observers viewed a sale of stock to the public as key to Macy's ability to finance the deal.

Friday, Federated and Campeau said that they were negotiating a $68-a-share deal, but could not offer assurances that such an agreement would be reached.

On Wall Street, the feeling was that the tenacious Robert Campeau, chairman of Campeau Corp., had finally made such a strong offer that Federated's board of directors had to cooperate.

But among other retailers, the feeling was that Federated would go to great lengths to avoid a takeover by Campeau.

Yesterday's events proved the point.