The Noam Elimelech (פרשת בא) let's us in on a little secret. HaShem thirsts for the prayers of Tzaddikim. Sometimes, he brings down hardship, simply to elicit their tefilloth. This is the case with Paroah. HaShem hardens Paroah's heart in order to get Mosheh to pray on behalf of Bnei Yisrael.
This leads nicely into my recent post about showing HaShem what we want via our prayers.