Q. If at that time (when lightning is seen during a rainstorm) I can’t say the bracha because my hands are unclean or I’m in the bathroom can I say it a bit latter?

A. This halocho is to be found in Shulchan Aruch (O.H. 227: 3) where the Mechaber rules that the brocho can only be recited within the short lapse of “kdey dibbur”, or the time it takes to say the words “Sholom Oleicho Rebbi”, and not after. If one can exit the bathroom within that period and if the hands are clean, the brocho can be said. (See Mishna Berurah ibid. 9)

Rabbi A. Bartfeld as revised by Horav Shlomo Miller Shlit”a.