The bill to protect 31 million Medicare beneficiaries against "catastrophic" doctor and hospital bills looked like the surest bet on Capitol Hill a few months ago, but today faces a rockier road than anticipated because of growing concerns about costs.

First proposed by Secretary of Health and Human Services Otis R. Bowen and endorsed by President Reagan, the bill immediately won a wave of congressional endorsements. It looked like an idea whose time had come. In July, a version more generous than the one proposed by Bowen barreled through the House, 302 to 127.

Since then, however, the bill's progress has slowed. Insiders still expect Senate passage and final action by a House-Senate conference, probably before the end of the year.

But growing public awareness that the program requires a large boost in premiums and an increasingly bitter dispute about a provision that would pay a large portion of outpatient drug expenditures by senior citizens and the disabled may make the bill's future shaky.

Both the administration and James Roosevelt's National Committee to Preserve Social Security and Medicare have been calling attention to the fact that some Medicare enrollees in high-income brackets would have to pay new premiums as high as $900 a year under the Senate bill and about $600 under the House version. The premiums would be on top of the current $17.90 a month.

Estimates of the cost of the drug benefit by different government agencies differ so widely -- from $1.6 billion a year to more than $6 billion -- that there is a growing uneasiness on Capitol Hill about whether enough is known to go forward with that benefit.

In addition, the Pharmaceutical Manufacturers Association (PMA), which fears that the drug provision will clamp tight price controls on the cost of drugs paid for by the program, is fighting it. The drug makers' trade group has organized a major lobbying campaign, calling Medicare beneficiaries to emphasize the possibility of new costs and premiums. The campaign reportedly costs $3 million.

As a result, as the bill heads for the Senate floor, senators are receiving a surge of constituency mail questioning the premiums.

"While members of Congress were home they did hear concerns about the financing of the package generally," conceded a spokesman for the National Council of Senior Citizens (NCSC), which supports the bill.

"In our state, a lot of people are concerned about the premium cost for the whole bill," said an aide to Sen. Chic Hecht (R-Nev.). Other congressional aides agreed, noting an upsurge of mail about the bill, which would authorize the biggest expansion of Medicare since 1965.

Under the version from the Senate Finance Committee, Medicare would pay for up to 365 days of hospital care annually after the patient pays an initial deductible of about $550. Only the first 60 days are free under current law after payment of the deductible. Moreover, out-of-pocket costs to the patient for all inpatient and outpatient Medicare-covered services would be limited to about $1,700 a year.

The House version has similar provisions and other new benefits, plus an entirely new outpatient drug benefit, under which Medicare would pay 80 percent of all outpatient drug costs exceeding $500 a year. The provision, the one opposed by the drug manufacturers' group, is strongly favored by organizations of the elderly.

The Senate bill, sponsored by Finance Committee Chairman Lloyd Bentsen (D-Tex.), has no drug provision. But Sen. John Heinz (R-Pa.) is expected to offer a floor amendment to cover 80 percent of outpatient drug outlays exceeding $600 a year.

Under both the House and Senate bills, all costs of the new benefits would be financed by premiums on Medicare beneficiaries.

Part would be paid for by a new premium for every enrollee. Under the Senate bill it would be $4 a month, beginning in 1988. Under the House bill it would be $2.60 a month starting in 1989.

The rest would be financed through an income-related premium to be paid by about 35 percent to 40 percent of the 31 million enrollees. The rest of the beneficiaries would fall below the income cutoffs for the income-related premium.

The American Association of Retired Persons (AARP) -- which is supporting the bill despite misgivings about financing it wholly from premium increases -- recently calculated that the income-related premium in 1989 would be zero for individuals with less than $10,000 total income (including Social Security), but would rise to $460 a year in the House version and $82 in the Senate version for individuals with total income of $17,500. At $20,000 in income, the premium would be $580 in the House version and $109 in the Senate bill. At $50,000, the premiums would be $580 in the House version and $850 in the Senate version.

Concern over costs has been prompted in three ways: the PMA phone campaign; administration statements calling attention to premium levels, and a massive mail campaign by the Roosevelt group.

It sent letters to 1.5 million older people, warning that the premiums will bring "huge increases in your Medicare costs."

Ken Hoagland, organization spokesman, said he expects "70,000 to 80,000 letters from our members will be hitting {congressional offices} in the next few weeks." He said the group prefers that some of the bill's funding be from other sources -- such as the roughly 3 million exempt state and local government workers. "Without a broad-based financing plan, the National Committee cannot support this bill," he said.

Although the AARP and the NCSC are seeking financing changes, they are working for passage.

Rep. Fortney H. (Pete) Stark (D-Calif.), chief sponsor of the House-passed measure, argues that the burden will not be as great as it appears, since many well-to-do seniors who pay $550 a year or more for private Medigap insurance will be able to rely on the new benefits.

The Congressional Budget Office has estimated the 1990 cost of the House drug benefit at about $1.6 billion, but the Department of Health and Human Services estimates more than $6 billion. A well-known independent researcher, Gail Wilensky of Project Hope, estimated $5 billion in a PMA-financed study.

The portion of the premiums designed to pay for the drug benefits is based on the CBO figure. In both the House and the Senate there is extreme uneasiness about approving a benefit when there is so much disagreement about costs.

Fears that disabled AIDS victims will obtain Social Security disability coverage adds to the unease. After a two-year waiting period, these patients would be eligible for Medicare and the outpatient drug benefit. They could then obtain costly anti-AIDS drugs through Medicare, boosting the cost of the drug benefit.

But the cost dispute goes deeper. The administration, in an Aug. 5 study, estimated that the costs of the benefits in both the Bowen proposal and the Senate Finance Committee bill would be covered by the higher premiums. But the study said that by 2010, the financing in the House bill would fall $58.5 billion a year short of covering the costs of new benefits.

The study used the high HHS drug-cost estimates and estimated that the annual premium increases written into the House bill for nondrug provisions would not cover cost increases. Supporters of the bill strongly dispute these estimates.

Despite the problems, observers expect final enactment. But they say it will not occur until heavy battles over the numbers are fought.