I haven't dealt with that sort of thing myself, but I've thought about it and read a little about it. Here are a few ideas I came up with:
1. Make sure the party knows what they're getting into and is appropriately armed. NPCs, such as a Solamnic knight, might be a good way to do this.
2. If the players have time, let the party's wizard develop a spell that weakens dragons of that type and offers some benefits against them. Watch the spell balance and target it against only one type of dragon, maybe as a ranged touch spell.
3. Watch the age of the dragon. This is the key determing factor of a dragon's power. Also, up the HD from the previous age category rather than just moving up a category to balance the encounter. Let them run into something weak like a white or black dragon at first rather than a blue or red.
4. Encourage the players not to attack the dragon's lair head-on. Provide subtle hints about servitor creatures and traps in the area to allow them to strip away the layers of the dragon's defense one at a time. If they are crazy enough to ignore these hints, they will deserve it when the dragon slaughters them.
5. Proper tactics and foresight are powerful allies and can do much to even the odds. So can larger weapons like ballistae. If they can hire a few mercenaries to man these weapons and provide some magical defenses for the crews and equipment, this can offset some of the dragon's raw power.
6. If they lose because they were unprepared, have the dragon humiliate them and take their gear awway. This will encourage the players to develop better tactics and get a bit more innovative. Try to let the wizard keep his spellbook, however. Perhaps they sneak it out under the nose of the dragon, the wizard hides it, or some other such simple but effective ploy.
I hope those ideas helped. I was trying to cover all the bases, so there's certainly stuff in there you already know. Just being thorough. Good luck!