Sentence 1 means that it's still raining hard.
Sentence 2 could mean the same thing but it would not highlight the duration of the action. It could also mean that it rained hard for a certain period of time in the interval between "last night" and the moment of speaking, but that it is not necessarily still raining. For example, one could say
"” It has rained hard three times since last night
Sentence 3 could mean that Mary was still waiting, but it could also mean that the waiting was over. The past perfect treats the waiting period as a compressed, not extended, period of time.
Sentence 4 portrays the waiting period as long and drawn-out, and makes it clear that Mary was still waiting, at least until that very instant.