The Rosh in Parshas Vayeira says that if you visit a sick person who is
sleeping, you still have fulfilled the mitzva of Bikur Cholim because when he wakes up
they will tell the sick person that you visited and he will feel good. What
about someone who is in a coma? Is there a mitzva to visit him?
The gemara implies that the mitzva of bikur cholim is to take care of the
sick person's needs. If there is something you can do for the comatose patient,
says Rav Chaim Kanievsky, you certainly have performed the mitzva. The Shita of
the Rambam is that the mitzva is to daven for a sick person's recovery. Rav
Chaim says that if your visit will cause you to daven, this may be part of the
mitzva and you should go visit.
[From Revach.net w/ permission]
Maran Harav Hutner in a letter [לג בספר האגרות] talks about visiting the ill via telephone. He explains that the word לבקר doesn't mean to visit but strictly speaking it means to "investigate" [as the Torah says בקורת תהיה]. One must investigate in order to determine if anything can be done on behalf of the ill person. This can be accomplished by telephone.
However, the mitzva of consoling mourners may not be done by telephone. Why? To explain this you have to be Rav Hutner:-).
The gemara in Ksubos [סט] asks מנין שאבל מיסב בראש - How do we know that the mourner sits at the head? A pasuk is then quoted to that effect. We see from this gemara that there must be a sense of קביעות - of being set in one place and not just a happenstance consolation . This cannot be accomplished via the telephone. Based on this, he explains the lineup of people on opposite sides which the mourner walks through after the burial [called a שורה]. The idea is that there is a mitzva to console the mourner, but we must first establish some semblance of קביעות. We do this by standing in an two organized lines.
Rav Moshe Feinstein [אג"מ או"ח ח"ד סי' מ] learns from the gemara in Shabbos [קנב] that ther eis a benefit to the מת when people actually come to the place of mourning which cannot be accomplished by telephone. Both he and Rav Hutner agreed that if one is unable to actually come, he should at least call.
See the interesting insight of Rav Soloveichik in מפניני הרב page 262.
More מראה מקומות for the scholars out there...
שו"ת באר משה ח"ב סי' קו וס' תשובות והנהגות ח"ב סי' תקפז ופני ברוך סי' יא בשם שו"ת מנחת דוד סי' עב עג וספר
נשמת ישראל סי' כד אות ו