SHOULD A TERMINALLY ill patient or his family have the right to decide whether or not to continue the life-sustaining treatment made possible by new technology? Last week, two courts grappling with this question authorized doctors to stop treatment.

Charles Perricone, an elderly Long Islander, had been in poor health when he suffered two heart attacks. Though placed on a respirator, he was declared "brain dead" on Dec. 14. The hospital refused to grant his family's request that the mechanical respirator be stopped, even though one of his children, a priest, testified to his father's often-expressed wish not to have extraordinary treatment in such circumstances. After 12 days, a New York court ordered the life-support systems removed.

William Bartling, a Californian, was suffering from five usually fatal conditions: emphysema, arteriosclerosis, cancer, chronic respiratory failure and an abdominal aneurysm. He had made a living will, and he was conscious and competent when he asked physicians to turn off his respirator. They refused on the grounds of medical ethics, but a California appellate court held -- after Mr. Bartling had died -- that the right of a competent adult patient to refuse medical treatment is constitutionally guaranteed.

Is there not a better way to handle these cases than by litigation? Certainly as society learns to cope with the dilemmas that accompany advanced medical technology, legal guidelines will be developed. But each case is different. The decisions of competent adults, for example, should be respected, but a judgment must always be made about competence. Some patients become extraordinarily depressed in the course of a debilitating illness that may not be terminal. Doctors must continue to be allowed to take that into consideration. They must also weigh the directives of relatives against the right of an incompetent patient to live a little longer or in a severely handicapped condition.

Doctors take risks when they make or comply with these decisions. They can be sued by relatives for withdrawing treatment or by patients for continuing it. Even when all parties agree, they can be criminally prosecuted for murder, as were two physicians in Los Angeles two years ago.

Last week's cases in New York and California did not present unusually complicated questions. The courts settled them, we believe, correctly, as perhaps the hospital medical staff should have in the first place. While there will always be extraordinary situations that require outside intervention, these recent decisions should set some guidelines for the settlement of similar cases -- without resort to litigation.