House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) and Minority Leader Robert H. Michel (R-Ill.) put aside their long friendship and clashed yesterday over what a reelected President Reagan might do to Medicare, with O'Neill renewing a Democratic charge that he would propose big cuts in the program.

Michel used unusually sharp language in responding, calling O'Neill, who made his remarks in a speech in Boston, "a flim-flam man" who "demeans the House of Representatives."

"There is no threat to Medicare," Michel said, and "there won't be any."

Their exchange underscored what has become a major issue in the election campaign: whether either party will move next year to rein in the big health insurance plan for the elderly and disabled, which last year paid $57 billion toward the hospital and doctor bills of almost one-seventh of the population.

Earlier in the campaign the issue was Social Security, whether Reagan might move to cut benefits. He ruled that out. The debate then shifted to Medicare, a companion program.

Democratic presidential nominee Walter F. Mondale says the Reagan administration wants to cut Medicare by $20 billion over several years. Vice President Bush contends that Mondale wants to cut it $12 billion a year.

Who is right? Technically, both are.

The problem is that the Medicare trust fund may be running dry.

For years U.S. health costs have have been rising faster than the general inflation rate. One result is that income from the Medicare portion of the Social Security tax has begun to lag behind costs and experts say the main Medicare trust fund will go bankrupt between 1990 and 1995 if Congress does not act.

Program officials have estimated the fund needs nearly $200 billion in added revenues to survive through 1995. The Congressional Budget Office, using different assumptions, puts the figure at $56 billion.

President Reagan in 1983 proposed Medicare cuts that would have totaled at least $25 billion over five years if all had passed. In the 1985 federal budget, Reagan proposed cuts totaling $18.8 billion over five years.

Mondale, in health policy papers, said he would cut Medicare outlays by amounts rising to $12 billion a year by 1989 and more later.

But while both candidates have proposed outlay cuts, there appears on the basis of their statements or past policies to be a fundamental difference in the way they would go about it.

Mondale says he would make all his promised cuts by squeezing amounts paid to hospitals, doctors and other medical groups, without eliminating any benefits or charging patients more.

And he has said he would not do it for Medicare alone, because that would merely cause hospitals and doctors to start charging non-Medicare patients more, while cutting corners on care of Medicare patients.

Instead, according to position papers and an adviser on health and social policy, Mondale would impose an annual cap on the increase in health payments by all parties to hospitals, doctors and other providers of medical services.

Such a cap, which President Carter also proposed, would be set a few percentage points above the expected increase in the consumer price index to allow not only for inflation but also for technological improvements and population growth. Mondale spokesmen say that even though medical costs could thus rise more than inflation, the increases would be less than have occurred historically.

Each state would be responsible for making certain that total health payments to providers of medical services in the state did not exceed the cap.

How it would be done would be up to the state. It might regulate the rates charged by hospitals, as is done in Maryland and several other states. It might also set fee limits for doctors and nursing homes.

Mondale aides estimate that by imposing a lid on charges by hospitals, doctors or other medical providers, the cap would save $12 billion a year by 1989 (and more later) for Medicare, without reducing benefits, and $25 billion or so for private insurance firms, individuals and others paying for health care for the rest of the population. They say the Medicare cost reductions would be enough to save it from bankruptcy.

Reagan, based on past statements, would oppose Mondale's national across-the-board, health-cost cap. So far in the campaign, he has not laid out any Medicare rescue plan, and aides have refused to discuss what he might do.

But based on his record, he might well seek to restrain Medicare outlays the same way he has in the past: in part through squeezing payments to hospitals and doctors, in part by cutting patients' benefits or increasing what patients must pay out of pocket.

For example, in 1983, Reagan proposed giving hospitals a fixed payment per case for each Medicare patient. This prospective payment system, now in effect, has the aim of squeezing hospitals on costs without reducing benefits and is similar in thrust to what Mondale is proposing for all payers.

On the other hand, in 1982 and 1983, Reagan proposed a major plan to make Medicare patients contribute to their second through 60th days of hospitalization, which they now get free. It would have cost patients $4.1 billion over the first three years.

In his fiscal 1985 budget, Reagan proposed major benefit cuts: eliminating the first month of Medicare eligibility, and raising the Medicare deductibles and premiums for the doctor-insurance part of the program. That would have cost beneficiaries $10 billion in the first five years.

A nationwide cost-control plan similar to Mondale's was proposed by President Carter but defeated by the House in 1978. Hospitals and others argued it would be a massive straitjacket with rigid government controls.

Dr. Robert J. Rubin, assistant secretary of health and human services for Reagan's first three years, said the danger in the Mondale plan is that "if there is a lid and it is too low, providers will have to start rationing care."

Mondale advisers such as Dr. Philip Lee of the University of California argue there is enough fat in the nation's medical care system -- Lee says 20 percent of all outlays represent waste and overutilization -- to squeeze hospitals and doctors quite a bit without any real reduction in benefits.