Margaret Lydick, 70, has a medical history that includes major illnesses and surgery, and she must take medicine for other ailments that could be crippling. But the Bladensburg widow has lost the Medicaid benefits that paid for medication on which her life sometimes depends.

She gets some help from her family but said that "they have their own problems and can only do so much."

Lydick, whose monthly income totals $293 in Social Security and veteran's survivor payments, is one of about 18,000 elderly residents of Maryland who have lost their Medicaid benefits, or soon will lose them, because of a change in the way the state determines maximum allowable income for eligiblity.

Until last July Maryland officials had ignored all cost-of-living increases in Social Security benefits granted since 1971 when determining if elderly persons were qualified for Medicaid, according to Harry F. Walker, deputy director of the state Office on Aging.

"This meant that persons who had had incomes of $150 (a month) or less in 1971 were able to retain eligibility even though their incomes increased," he said.

But last year the federal government told state officials that disregarding increases in Social Security payments did not meet federal standards and that Maryland would have to end the practice or lose the matching funds it received from Washington for the Medicaid program, said Walker.

"The state was unwilling to pick up the full cost of the program and therefore changed its method of determining eligibility . . .," Walker said.

Under the revised procedures the income cutoff levels remain at $150 monthly - or $1,800 annually - for a single person and $2,500 a year for a couple, but as of last July cost-of-living increments in Social Security benefits must be counted in determining the maximum.

Officials in Prince George's and Montgomery counties said it is difficult to determine how many elderly persons in the two jurisdictions have lost benefits. Using the state estimate of 18,000 persons who have lost Medicaid eligibility, local authorities said several thousand of them could be from the Maryland suburbs of Washington.

Many are like Mr. and Mrs. George Martin of Brentwood, who lost their Medicaid benefits in July. Mrs. Martin works two days a week in a clothing store, but Martin, 76, a retired truck driver, cannot work now because he is subject to seizures.

The Martins' combined annual income, including Social Security payments, is about $4,000; of this amount nearly $1,000 goes for the real estate taxes on their home. Even refilling a needed prescription now is delayed for lack of funds, the Martin said.

Ellen Myers, 74, of Oxon Hill, is a widow who suffers from congestive heart failure, emphysema and arthritis. She must use a tank of oxygen every two weeks, along with other medication that costs $165 to $175 a month.

Myers, who lives in public housing and has a monthly income of $265 in Social Security payments, lost her Medicaid benefits last July. She appealed for help and got a temporary reinstatement of the benefits.

The plight of elderly persons such as Myers and the Martins is an example of "giving with one hand and taking away with the other - and sometimes taking more than giving," said Magan Pathik, project director for the Prince George's County Area Agency on Aging.

"When you have a program that is designed to serve the poor, it is understandable that eligibility rules are needed," said Don Wassmann, director of the Montgomery Country Division of Elder Affairs. "But if the eligibility base is not changed when a cost of living increment is given, the result can mean increased hardships for those who really need increased help."

An ad hoc committee of Betterment for United Seniors Inc. (BUS) in Prince George's County has charged that the changes are causing "needless suffering and anguish" for a large number of Maryland's senior citizens. The committee, known as HARM (Helping the Aging Restore Medicaid) has proposed that the eligible income level of $150 monthly, in effect since 1966, be raised and that in the meantime emergency funds be used to restore benefits.

Democratic Rep. Glady's N. Spellman of Prince George's County is co-sponsoring a bill in the House that would exempt cost-of-living increases in Social Security payments from the maximum income allowed Medicaid beneficiaries. The bill now is in the committee on health and the environment, and action is not expected until next year.

Elderly persons in serious need should call the following numbers for information and help: Prince George's County, 925-4477; Montgomery County, 279-1900; the city of Rockville, 424-8853.