What shall we say then? Is there injustice on God’s part? By no means! For he says to Moses, "I will have mercy on whom I have mercy, and I will have compassion on whom I have compassion." So then it depends not on human will or exertion, but on God, who has mercy. For the Scripture says to Pharaoh, “For this very purpose I have raised you up, that I might show my power in you, and that my name might be proclaimed in all the earth.So then he has mercy on whomever he wills, and he hardens whomever he wills.
In 2003 Piper preached on this text. Shortly afterward he composed this hymn based on this passage, sung to the tune of “O For a Thousand Tongues!”:
Is there injustice with our God
When he decrees our ways?
No! This is but his righteousness
And root of all our praise.
Does he make mercy hang on this:
If we can will or run?
No! He has mercy on his own:
Before the world, it's done!
Did Pharaoh rise and make his name
Renown, and flaunt his mind?
No! He displayed his Maker’s fame,
And did what was designed.
O that we had a mind to grasp
The depths and riches of
The wisdom of the ways of God
And mysteries of love!
Now let no sin cause you to flee
Or make you suffer loss,
Our God is free, and Christ has died
Rejoice before his cross!
[Also read J. I. Packer's article, "Is God Unfair?"]