The Rev. Peter Walsh has always treasured the tactile job of performing last rites for his congregants before their deaths, noticing with awe the way anointing a person with holy oil and laying his hands on their body seems to make them approach their last moments more easily.

But William Pike, a 91-year-old member of Walsh’s Episcopal church in New Canaan, Conn., was dying of the novel coronavirus.

Walsh realized he would need to do something he had never done before: He administered the last rites by FaceTime.

Pike was unconscious, but a hospital staff member recharged his iPhone and held it up to him, and Walsh believed his friend could hear him. “I told Bill I loved him, that he was mightily loved by his whole community. That he was a great man,” Walsh said in an interview. “I believe in the power of the Holy Spirit to do things that we cannot make sense out of. I simply imagined that the hands of the Lord were laid upon him, and not my hands.”

Across the country, clergy of all religious traditions are struggling to do some of the most challenging and most personal parts of their job in a time of new restrictions on in-person gatherings: ministering to the sick, the dying and the bereaved.

These difficult moments, which often call for a religious ritual such as anointing a dying person with oil, or just for a calming and reassuring touch, are especially hard to conduct now, when many hospitals have banned visitors and virtually all Americans are being urged to remain physically distant from others.

“In our hospital, some chaplains have already been in the room with a patient so they can have their family on the phone and have them say their goodbyes. There’s been a lot of FaceTime,” said Sondos Kholaki, a Muslim chaplain at an Orange County, Calif., hospital. “It’s less than ideal. There’s no really nice way to say it. It sucks. It’s lonely. It’s isolating.”

But Kholaki knows it’s essential for clergy and family members to distance themselves, reserving scarce masks, gowns and other protective equipment for the medical staff.

Some clergy, especially in traditions such as Catholicism that emphasize the importance of rituals being carried out in person, are going to new lengths to minister to the sick and dying safely. Priests are suiting up in personal protective equipment like a doctor or a nurse, to stand by the bedsides of people on the brink of death.

Others are bringing some of life’s most intimate and wrenching conversations online.

At Sharp Memorial Hospital in San Diego, Catholic chaplain Liz Mackenzie said the staff chaplains have offered telephone counseling to 15 coronavirus patients so far — no in-person visits allowed. When she offered to pray over the phone with one man in the intensive care unit who was suffering from the virus, the man grew too short of breath to continue the conversation. “We had to sit in silence,” she said.

For Catholic patients, Mackenzie has sought out information to share about the Vatican’s directive that bishops can choose to allow “general absolution” — a resolution for any person’s sins before their death even without the in-person confession to a priest that is normally called for — if the coronavirus makes it too difficult for a priest to be at the bedside.

U.S. bishops so far have not taken the Vatican up on that offer, by and large. In Springfield, Mass., the diocese announced nurses could anoint patients with oil instead of a priest and then quickly reversed course.

But Mackenzie says her patients have been willing to accept a telephone blessing from her rather than insisting on receiving the sacrament in person.

“People are disappointed, but they’re also very understanding. … They’re usually happy just to have a blessing,” she said. “That’s really what people are looking for, somebody to connect with, to see them — to see their fears and vulnerabilities and still want to be connected. And that’s something we can try to do on the phone. But its easier to do in person.”

In the Diocese of Arlington, the Rev. Paul Scalia, who serves as vicar for clergy, said priests have suspended their ordinary in-person visits to the elderly and homebound, and all of their other usual sacraments, including Masses. “Our Lord works definitely through the sacraments, but he is not limited by the sacraments,” Scalia said. “He can still come to us.”

But deathbed visits would be the very last duty that Scalia would want to give up, and he said Arlington’s priests are prepared to perform last rites in person whenever possible. “Death is where the rubber meets the road,” Scalia said. “That is where we want the presence of Christ the most. Catholics throughout the world pray the Hail Mary: ‘ … now and at the hour of our death.’ We need Him especially then. That can be the time of the greatest fear and the time of greatest anxiety. We want to make sure Christ is as present as he can be to that person.”

In New York, Rabbi Sharon Kleinbaum and her synagogue of about 1,300 members have been through contagious plagues before. At Congregation Beit Simchat Torah, an LGBT synagogue, 40 percent of the congregation died during the AIDS crisis of the 1980s, Kleinbaum said. “We know the power of creating communal support systems, and not disappearing when people get sick, and not being afraid of being there when things get ugly,” she said. “I believe God demands of us: Be present.”

But what happens when you can’t be present?

Kleinbaum is finding out — about 15 members of her synagogue have coronavirus, and she finds herself texting prayers to patients instead of sitting by their sides. Her congregants are dropping off groceries at the doorsteps of elderly members too scared to leave their houses, and at the houses of those who have lost their jobs.

Last week, Kleinbaum led a shiva minyan, the traditional gathering of Jewish mourners after a death, unlike any she has ever seen before.

The deceased had passed away from the coronavirus, and his wife had the illness, too. She coughed badly throughout the gathering. Their son and daughter, also sick with the virus, managed to attend. In the next room, the daughter’s husband was so feverish that he couldn’t get out of bed.

Still, they sat shiva, alone in their home, but also in the presence of 150 friends and family — who gathered on a Zoom call.

Read more: