Deus ex machina literally means "The god from the machine". In ancient Greek drama, this was a term used for a mechanical device which would lower a god onto the stage to intervene and provide a solution to the conflict at hand. Currently, this term is still used of works of literature and drama. The modern usage of deus ex machina is to refer to any rescuing agency introduced by a writer to bring about a desired conclusion, usually without much regard to logic, character, or the situation.
Some examples would be commonly found in James Bond movies, where 007 always seems to have exactly the right device to solve whatever situation he is in. This was also something I dislike about the Superman movies. No matter what he gets attacked by, he just happens to have the power to undo whatever his attacker is using against him. (Bullet to the eyeball? No problem!) I'm sure there are better examples than these two, but hopefully you get the idea.
Next time you see a solution to a problem in a story that really seems to come out of nowhere to save the day in an implausible way, you can call it a deus ex machina.