You could also have an NPC with just the right spells drop in, some legendary efreeti-hunter for example:
"Ladies & Gentlemen, I, Yappy McColdmage, Gentleman Adventurer, heard you had problems with an Efreeti? This here specimen is far too weak to warrant my full, personal attention, yet I shall help such promising fellows as yourselves in your first Efreeti-slaying, of many to come, there's hoping! Here you go with some Mass Fire Resistance, and here's some Mass Fly, to boot. I also have a scroll of Glitterdust, should you require it, but I will be obliged to charge going rates for it, I'm sorry to say. Good luck!"
Another way would be for the Efreeti to become a recurring villain: don't plan on it to be defeated just yet, have it whoop the party's collective behind for now, but have the party stop its plans (whatever they are). Later on, when the party meets the efreeti again, they may be more powerful, better equipped, and overall more knowledgeable of what they need to bring to the fight in order to win it.
Finally, a more... didactic approach might be to have the party charge right in, and play the fight out normally. Some fights are hard, and that's how the game is meant to be played. PCs do die from time to time, and there's nothing for it. If it happens, it happens. Just stay away from a TPK, those are no fun - when the Efreeti sees the party is no match for it, it could just fly away.