When heaven is shut up
As it may be said to be when the air is quite serene, and not a cloud in it:
and there is no rain;
in its season, neither the former nor the latter, as it was in the times of Elijah:
because they have sinned against thee;
want of rain was threatened in case of sin, and was always the effect of it, ( Leviticus 26:19 Leviticus 26:20 ) ( Deuteronomy 28:23 Deuteronomy 28:24 ) ,
if they pray towards this place;
in any part of the country where they were; for it sometimes rained on one city, and not on another, ( Amos 4:7 )
and confess thy name;
own his power and his providence, and the justness of his dealings with them:
and turn from their sin, when thou afflictest them;
their affliction being made useful, to bring them to a sense of their sin, and to repentance for it, and reformation from it; or, "when thou hearest" or "answerest them" F7; so the Targum, receives their prayer; thus the goodness of God leads to repentance.