~A person must say a blessing upon the evil just as one says a blessing upon the good.~ Berakhot 60b
The force of this injunction is in the word evil, ra'ah. Evil is frequently a subjective term, but even those things which are subjectively bad must first be recognized as such if a person is to say the appropriate blessing. By referring to something as evil, the mishnah specifically points to an event which is *not recognized* as being a product of God's justice; else it would not be called "evil" but rather "just" or "hard" or "painful." This mishnah could be rephrased as, "Precisely when you feel least like saying a blessing, you must say a blessing."
-----
~A person who sees idolatry says, "Blessed [are You...], the Long Suffering.~ Tosefta Berakhot 7:2