In Sefer Mishlei, Shlomo Hamelech (a”h) teaches, “U’motzi Diba Hu Chesil – one who divulges negative information is a fool.” The chachamim infer from this pasuk that it is improper to go out of one’s way to unnecessarily report bad tidings. Therefore, for example, when a person passes away, it is sometimes advisable to withhold this information from an elderly relative, rather than forcing that relative into a state of Avelut. Needless to say, these decisions should be made very delicately and after consultation with a competent Halachic authority.
Rabeinu Yona (a”h) in his Sefer Ha’chasidim imposes a significant restriction on this Halachah. He states that it applies only when there is no benefit yielded by reporting the bad tidings. When, however, relaying the information serves a beneficial purpose, one must certainly report the news. The Sefer Ha’chasidim cites the example of Avraham Avinu (a”h), who was informed that his nephew, Lot, was taken into captivity (Bereishit 14:13). Relaying this information was necessary so that Avraham could go rescue Lot, and it was therefore appropriate under the circumstances. Similarly, the Gemara on several occasions tells of Rabanim who were informed of someone who had fallen ill, so that they could visit the patient and lift his spirits. Therefore, it is certainly appropriate to inform a Rav of somebody who is ill so he could go visit, and to convey the information to friends and relatives so they could visit the patient or offer assistance.
Likewise, the Torah Hakedoshah informs us that Yosef Ha’tzadik (a”h) was informed of his father’s grave illness. We know from a number of sources that there is immense value for a parent to speak to his children before his death. Indeed, the chachamim teach that Yaakov specifically prayed to Hashem that he should fall ill before his death, so he would have advanced warning of his imminent passing and would thus be able to speak to his children before his death. A number of sefarim – including Ma’avar Yaok and Nit’eh Gavriel – emphasize the importance of family members being at the side of their loved one when he or she passes away. Therefore, when a person falls dangerously ill, the family members must be notified so that they can be by their loved one’s side during his final moments.