The Torah tells us that Yosef, some time after agreeing to his father's request that he bury him in Eretz Yisrael, is informed that Yaakov has taken ill and he immediately goes to visit him, together with his sons Menasheh and Ephraim (בראשית מ"ח:א'). The Gemara in Bava Metzia (דף פ"ז.), quoting this Posuk, indicates that until the time of Yaakov, there was no illness in the world; it was Yaakov who actually requested that people should become sick. Rashi (שם בד"ה בעא רחמי והוה חולשא) explains that he did this in order that a person should become sick before his death and realize that it is time to give his final commands to his family. It is thus quoted by Tosafos in Bava Basra (דף ט"ז: בד"ה שכל) that sickness itself did indeed exist in the world prior to the days of Yaakov; what did not exist was sickness that led to death. It is recorded in Pirkei DeRabbi Eliezer (פרק נ"ב) that until Yaakov's time, people died quickly without any illness in advance; Yaakov then Davened and asked that Hashem have mercy and enable him to address his family before his death. Hashem answered this Tefillah and Yaakov indeed took ill before dying. The Radal (שם אות י"ז) quotes that Yaakov actually made this request for all people forever, not just for himself, and when this Tefillah was accepted, this situation became part of the natural order forever.
It is noteworthy that in the Gemara in Sanhedrin (דף ק"ז:), where this idea about Yaakov's request for illness is also found, Rashi (שם בד"ה בעא) says that the reason was to enable his children, upon hearing that he is sick, to gather and be with him before his death. The Maharsha in Bava Metzia (חידושי אגדות לב"מ שם בד"ה אתא) points out that Yaakov never actually called Yosef or his brothers to come to him, because the information that he was sick was itself enough to generate the obligation upon his children to visit him. We thus see that it is of particular significance for family members to visit a deathly ill relative.
The Mitzvah of Bikur Cholim, visiting the sick, however, is, of course, not limited to the family of the sick person, although in the Yerushalmi in Peiah (פרק ג' הלכה ז', דף י"ח.) a distinction is drawn as to when to come visit between family members and close friends and others, which is codified in the Shulchan Aruch (יורה דעה סימן של"ה סעיף א'). Nor is the Mitzvah limited to visiting only a person whose illness will lead to death. The Gemara in Nedarim (דף מ.) documents the greatness and the significance of the Mitzvah of Bikur Cholim, while the Gemara in Shabbos (דף קכ"ז.) lists it among those Mitzvos from which one derives great benefit in Olam HaBa. The Gemara in Sotah (דף י"ד.) states that the obligation to visit the sick stems from the general obligation found later in the Torah (דברים י"ג:ה') requiring one to follow in the ways of Hashem. The Gemara (שם) explains that since it is impossible for a human being to literally "follow" Hashem, the Posuk (שם) really means that one should follow His ways of behavior. Just as, therefore, He visited the sick when Avraham Avinu was ill (בראשית י"ח:א'), so too must every Jew visit the sick.
According to the Bahag (מצות קום עשה ל"ו) and the Semak (מצוה מ"ז), Bikur Cholim is counted as one of the Mitzvos of the Torah; the Sdei Chemed (כללים, מערכת הבי"ת, אות קט"ז) quotes others who appear to hold this way as well. This also seems to be the view of Rav Achai Gaon in the Sheiltos (פ' אחרי מות,שאילתא צ"ג); he quotes the Gemara earlier in Bava Metzia (דף ל:) which derives the requirement of Bikur Cholim from a word in a Posuk in the Torah (שמות י"ח:ז'), which implies that the Mitzvah is indeed from the Torah. The Ramban, in his commentary on the Rambam's Sefer HaMitzvos (שורש א', בד"ה והתשובה ג'), cites the aforementioned Gemara in Sotah (שם) about "following" Hashem as another source for this view. The Gemara earlier in Nedarim (דף ל"ט:), however, quotes a different Posuk in the Torah (במדבר ט"ז:כ"ט) as providing a רמז, a hint, to the requirement of Bikur Cholim in the Torah; the Meiri (בית הבחירה שם בד"ה מצות) thus writes clearly that Bikur Cholim is a Mitzvah MideRabbanan, as does the Rambam (פרק י"ד מהל' אבל הלכה א'). In the Sefer HaMitzvos (שורש ב'), however, the Rambam himself notes that this Mitzvah may be subsumed under the broad Mitzvah to love one's fellow Jew as one loves one's self (ויקרא י"ט:י"ח) which is, of course, a Mitzvah from the Torah (עיין ספהמ"צ להרמב"ם מצות עשה ר"ו, ובספר החינוך מצוה רמ"ג).
In any case, no Beracha is recited upon performing this Mitzvah. The Rashba (שו"ת הרשב"א חלק א' סימן י"ח) explains that this is because the Mitzvah could possibly be cancelled suddenly if the patient decides he does not want any visitors, and the person would then be left having recited a Beracha over a Mitzvah which he cannot do; to avoid this problem, no Beracha was instituted in the first place. The Ohr Zarua (חלק א', הל' ברכת המוציא סימן ק"מ) writes that no Beracha is recited over a Mitzvah , like Bikur Cholim, which one has an ongoing obligation to fulfill and from which there is no time during which one is exempt. Since the obligation is constant, there is no suitable time at which to recite the Beracha. The Avudraham (שער ג', ברכת המצות ומשפטיהם, עמוד י"ט) quotes a view that no Beracha is recited over a Mitzvah which involves pain or discomfort for another person because it would appear that one is thanking Hashem for this misfortune; Bikur Cholim obviously falls into this category. Rabbeinu Bechaya, in his commentary on the Torah (לבמדבר ט"ו:ל"ח), writes that Berachos were instituted to be recited only for Mitzvos which demonstrate the unique Kedushah of the Jewish people, but not for Mitzvos which require behavior generally observed and accepted by all people. The Aruch HaShulchan (יו"ד סימן ר"מ סעיף ד') likewise writes that no Berachos are recited over Mitzvos which are logical and thus performed by other people as well; Bikur Cholim thus has no Beracha associated with it.
The aforementioned Gemara in Nedarim (שם) indicates that the Mitzvah of Bikur Cholim has no limitations, which means that an older person can visit a younger person (or vice-versa), and that one can perform the Mitzvah even many times a day. The Rambam (הל' אבל שם הלכה ד') accepts this ruling, saying that the more one visits, the more praiseworthy one is. He adds, though, that one may visit the sick person even many times a day provided that this does not disturb or annoy the patient; the Shulchan Aruch (יו"ד סימן של"ה סעיף ב') rules accordingly. Actually, the Gemara later (שם דף מ.) does indicate that there are certain hours during which one should not visit the sick. The Rambam (שם הלכה ה') explains that these are the hours during which the patient is attended to, and a visitor would only be in the way. The Shulchan Aruch (שם סעיף ד'), however, explains that during some of these hours, the patient looks healthier, so the visitor will not think that things are so bad, and during others, he looks sicker, which will cause the visitor to abandon hope. The Aruch HaShulchan (שם סעיף ח') stresses that this was only advice, not a prohibition, and thus today, people are not so concerned with this. It would thus appear that women too are obligated in the Mitzvah of Bikur Cholim, because the Mitzvah is not really connected to a specific time, and it applies constantly; the Aruch HaShulchan (שם סעיף י"א) discusses the issue of women visiting men, and vice-versa.
The Gemara (שם דף ל"ט:) also says that when one visits a sick person, he somehow removes some of the illness and makes the suffering more tolerable, and further on, the Gemara (שם דף מ.) states that one who fails to visit the sick person is considered as though he killed him; the Rambam (שם הלכה ד') mentions both these points. Rashi (שם בד"ה כאילו) explains that the reason someone who doesn't perform the Mitzvah of Bikur Cholim is likened to a murderer is that when one visits the sick, one takes care of the person's needs, thereby, presumably, assisting in his recovery; if people won't visit him, apparently, his needs won't be attended to and he may die more quickly. With this in mind, the Rosh on the page there in Nedarim (פי' הרא"ש שם בד"ה שכבדו) writes that when one visits a sick person, he should tend to all the person's needs; the Shittah Mekubetzes on Nedarim (שם בד"ה בשביל) adds that this includes things like taking care of the person's bed and cleaning the room. As the Perishah, commenting on the Tur (שם אות ד') notes, this is likely to calm the person down and make him feel more comfortable, and it is therefore part of the Mitzvah; the Shulchan Aruch (שם סעיף ח') thus requires this as well.
The Gemara in Nedarim (שם) further implies that the visitor must also pray on behalf of the sick person whom he is visiting. The Rambam (שם הלכה ו') writes that praying for Hashem's mercy upon this person is part of the Mitzvah of Bikur Cholim; the Ramo (יו"ד שם סעיף ד') rules that one who visits a sick person but does not pray for Hashem's mercy upon him has not fulfilled the Mitzvah. The Gesher HaChaim (חלק א' פרק א' סעיף א' אות ב') thus writes that the Mitzvah of Bikur Cholim really has two aspects: taking care of the person's needs, and Davening for him. He then adds (שם אות ג') that one should not burden the sick person with all kinds of advice and confusing suggestions, or display nervousness or sadness in his presence. The Beis Yosef, commenting on the Tur (יו"ד שם בד"ה ומצוה) actually already mentions these two aspects of this Mitzvah in the name of the Ramban in his Toras HaAdam (שער המיחוש), adding that the goal is to calm the patient down.
In the Sheiltos of Rav Achai Gaon cited above (שם), we find that one should not visit a sick person alone. In his commentary there, the Netziv (העמק שאלה שם אות ז') writes that he could not find any other source that mentions this. The Rogatchover Gaon, however, in his comments on the Posuk in our Parsha (צפנת פענח לבראשית מ"ח:א'), links this ruling to the fact that Yosef brought his sons with him when going to visit his sick father. It is clear from all of the above that the Mitzvah of Bikur Cholim is to physically be in the presence of the sick person. Rav Moshe Feinstein (שו"ת אגרות משה יו"ד חלק א' סימן רכ"ג) writes, however, that if this is impossible, one can fulfill the Mitzvah partially by speaking to the person on the telephone. Rav Ovadyah Yosef (שו"ת יחוה דעת חלק ג' סימן פ"ג) concludes as well that if it is impossible to visit the ill person, one should speak to him on the phone or write him a letter to strengthen and encourage him.