You've got a couple of variables there.
A. Was the encounter easy or hard
B. Have you figured out A during or after the combat
Easy Encounters:
Generally don't change any stats on the monsters (what someone else said). You run the risk of ruining the party's good tactics just because you're losing. In reality, most encounters get their punch from the setup/entrapment, so if you screw that up, or the players bypass it, then fair game applies.
If you find it too easy DURING the encounter, you have a few tricks left:
pause and look at the monsters goodies. See if you missed any cool features (feats, gear, specials) that you can use against the players. I often forget special powers on monsters
If the monsters are losing, have them run away. Try to figure out an escape plan to save as many of your monsters as possible. What fool wouldn't have an exit plan for if the PCs start winning. (this will also teach the players how to run away). Whether you use the escapees to reinforce a later encounter, or have them completely leave the area is up to you. You might have them come in and reinforce another encounter that you find is too easy.
If you find it was too easy AFTER the encounter, don't sweat it. Figure out what went wrong for the monsters and improve your tactics. Give out the XP as normal. Odds are good, you forgot something like the setup, or a special rule, or the players outwitted you. It's better to have an easy encounter than a TPK generally (and most players like that).
Hard Encounters:
This is harder to deal with. A lot of it depends on whether the players were really dumb, or just bad luck/situation.
If you figure out the encounter is hard AFTER the combat, you're kind of stuck. The results are in. You might try to have the monsters heal them and keep them as prisoners (I try to avoid that). Some DMs opt for the Dream-Sequence (I hate those). Mostly, I'd just let it stick as something for players and DM to learn from.
Now the ideal is to figure out the combat is too hard DURING the fight.
Then you have some options. If the players were just acting dumb (I mean really dumb) and not just in character dumb, then by all means start handing out Darwin awards. Be sure to differentiate from "I had to fight it" from "I'm the moron who decided to pick a fight with Lord Soth at the neutral leaders summit".
Still with me, then I assume you like your PCs...now to decide what effect you want. Do you want to make the fight easier, or encourage them to run. The third option is obvious and if you change nothing, it resolves itself (aka TPK).
Making it Easier: Roll damage and attacks behind a screen and reduce the amount of damage. Start provoking attacks of opportunity by moving the monsters more dumbly (rushing a farther away PC...). Don't use your nastier attack options. Don't just play the monsters dumb as that's too obvious. Simply stop making perfect tactical decisions.
Making them Run Away: The ideal for a hard encounter is for the PCs to figure that out and to retreat. Smart people (who get to be high level smart people) know their limits and know when to back down. The best thing to do as GM, is to make sure you leave the players some openings for retreat. That may mean moving monsters into spots where the players can get away. It may mean killing the unconcious PC so they don't feel like they have to save him by killing all the bad guys. It may mean making the monsters grab someone and then the monsters take off (which ends the encounter so the PCs can regroup and possibly jump start their tactics). You may also want to ask them if they want to retreat at some point (some people never even think to run away from a fight).
An encounter that was too hard is usually the hardest to deal with. Sometimes it was the GM's fault for writing a unfair encounter. Other times its the players' fault for rolling badly or doing something dumb. And still other times, its a fact of life that the party will encounter something that is tougher than it. The best thing to do as a GM is to make sure players can figure out that they're in trouble, and to make sure they have an escape route (never make too perfect a trap). If they're smart, they'll see it and use it, and the problem will resolve itself (players escape, encounter ends, no XP).
Just some thoughts,
Janx