The Gemara in Masechet Berachot introduces an obligation to recite a Beracha when one visits or comes upon the site where he experienced a miracle. The text of the Beracha is, "Baruch Ata Hashem Elokenu Melech Ha’olam She’asa Li Nes Ba’makom Ha’ze" ("Blessed are You Hashem…who performed for me a miracle at this place"). One recites this Beracha each time he finds himself at that site and had not been there for at least thirty days.
What constitutes a "miracle" for the purposes of this Halacha?
The Ben Ish Hai (Rabbi Yosef Haim of Baghdad, 1833-1909), in Parashat Ekeb (listen to audio recording for precise citation), writes that one recites this Beracha only if he was saved at that site in a supernatural manner, through circumstances that violated ordinary laws of nature. He gives the example of a wall, ceiling or large stone that fell upon a person, an occurrence that ordinarily results in death. If a person somehow survived this experience, then he recites the Beracha of "She’asa Li Nes" when he is at the place where this occurred.
There are other situations, however, which frequently result in death but a person could be saved through natural means. For example, if a person survived an armed robbery, or if a heavy object fell right next to him, he does not recite this Beracha. Since no supernatural occurrence transpired, the Beracha is not required when he goes to the site where he was saved.
The Ben Ish Hai then discusses a case which he is unsure whether or not to classify as a supernatural occurrence, namely, if a person suffered a gunshot wound or stabbing and the bullet or knife missed his vital organs. It is uncertain, the Ben Ish Hai writes, whether we can describe such an incident as a supernatural event. He therefore rules that if a person experienced such a situation and returns to the place where it happened, he should recite the Beracha without the words "Hashem Elokenu Melech Ha’olam."
Summary: If a person’s life was saved through supernatural means, such as if a collapsed ceiling fell on him and he survived, then when he goes to the place where this happened he recites the Beracha, "Baruch Ata Hashem Elokenu Melech Ha’olam She’asa Li Nes Ba’makom Ha’ze." One recites this Beracha every time he sees that site and had not been there in thirty or more days. If, however, a person escaped a dangerous situation through natural means, such as if something fell next to him, then he does not recite this Beracha.