Quotation for Berakhot 120:7
חייב אדם לברך כו': מאי חייב לברך על הרעה כשם שמברך על הטובה אילימא כשם שמברך על הטובה הטוב והמטיב כך מברך על הרעה הטוב והמטיב והתנן על בשורות טובות אומר הטוב והמטיב על בשורות רעות אומר ברוך דיין האמת אמר רבא לא נצרכה אלא לקבולינהו בשמחה
A man is in duty bound, etc. What means : A man is in duty bound to utter a benediction for the bad even as he utters one for the good? Are we to suppose that as for the good he says the benediction "...Who art good and dispensest good," he is to make the same benediction for the bad? For lo, our Mishnah teaches : For good tidings he says "Who art good and dispensest good" and For bad tidings he says "Blessed be the true Judge"! Raba said : It is only necessary that he should receive [the bad] with gladness.