They have the power to shut the heaven, so that it may not rain during the days of their prophecy; and they have power over the waters, to turn them into blood, and to strike the earth with every plague as often as they wish.
We read that Elijah by prayer shut the heaven and again opened it; and that Moses also turned the waters into blood. Therefore it must not be thought that Elijah will have less power when he comes to fulfill the duty of his preaching than he had at the time when he lived among men, but rather greater. We can also understand spiritually by “heaven” the Church, and by “rai...n” the words of the saints; for heaven is shut to the wicked when God in his judgment allows their hearts to be so hardened that in no way do they grant the word of God access to their heart so that they might be saved. For the prophet Isaiah also shut heaven to the Jews when it was said to him by the Lord: “Blind the heart of this people, and make their ears heavy, and shut their eyes; lest perhaps they see with their eyes, and hear with their ears, and understand with their heart, and be converted, and I heal them” (Isa. 6:10). Jeremiah also shut heaven to his enemies when he said to the Lord: “Do not be gracious to their iniquity, and let not their sin be wiped out from your presence. Let them fall down before you; in the time of your visitation they shall perish” (Jer. 18:23). Did not Moses have the power of shutting and opening heaven, to whom the Lord said, when the people had sinned: “Let me alone, that my wrath may be kindled against them and that I may destroy them, and I will make you into a great nation” (Exod. 32:10)? Therefore those holy men will shut heaven for some, so that the rain of the mercy of God may not descend upon them, namely for those whom they have not been able to recall from the errors of Antichrist; but for others they will open it, namely for those whom they will have recalled from the errors of Antichrist; and they will pour rain upon them when by their prayers they make God favorable to them. By the waters which they are said to turn into blood, peoples are signified; but the blood shows divine vengeance. Therefore they will turn the waters into blood when, by their own judgment, they decree that the nations which have departed from the faith of Christ are to be condemned to everlasting death.
Source: Commentary on Revelation