A deus ex machina is not always or necessarily a cop-out. The end of the Book of Job utilizes two deus ex machinas and very good ones they are too (although the first--God shows up—is much better than the second—Job gets everything back).
The difference lies in whether or not the deus ex machina is a natural outcome, the logical next step in the progression of the story, or whether it is the result of lazy writing.
Two of the greatest TV cop-outs (at least in the last ten years) have been the death of Assumpta in Ballykissangel and the non-marriage of Xander & Anya in Buffy.
Death is almost always a cop-out, unless you're Shakespeare and you're just killing off people for fun (or because you can't pay them anymore). Unfortunately, in a generation raised to consider Shakespeare PROFOUND, death has become an easy way of sounding profound without having to go to the trouble of actually being profound. The Ballykissangel folks as much as admitted that Assumpta's death was used to shake things up, get the town of Ballykissangel out of its rut. They felt that things were getting too nice, too comfortable. So they killed off a major character.
You couldn't get more teenage novelish.
Death is easy. Death has all the merit of being SO BAD that it looks clever. It is much harder and takes much better writing to shake things up without killing someone.
In Ballykissangel, Assumpta and the Catholic priest of the town, Father Clifford have fallen in love. There are numerous directions this situation could have gone: they could have decided not to pursue their feelings; they could have gotten married and it could have failed (I'm not in favor of this because I think it is a cop-out of a different variety); they could have decided that they should get married and done the hard work of figuring out how to make it all work; they could even have done a Thorn Birds thing in which Father Clifford tried to justify an affair but still remain a priest.
They did none of those. They had Father Clifford fall head over heels in love with Assumpta. They had him fret about it for half a season. They had him decide that he would make all the sacrifices in order to marry her. And then they killed her off.
Give me a break.
It was completely out of character, first of all, for Father Clifford to fall for Assumpta in the way that he did. The first things you learn about Father Clifford is that he is an extrovert, that he has a creatively administrative mind and that he likes being a priest. I find it believable that Father Clifford would decide to apply his talents as a husband and father and citizen rather than a priest, but I don't believe for a second that he would suddenly decide that he never really wanted to be a priest in the first place and that Assumpta is all that he needs.
Love 101 (and this is true even for diehard romantics): Love ain't enough. What brings people together isn't just the warm fuzzies. It's sex, yes. And it's person A finding something in person B that satisfies them: sometimes it is how person A sees him or herself; sometimes it is what person A wants to get out of life; sometimes it is how person A wants to be treated.
The smartest lady in the world, Jane Austen, figured this out. In Sense & Sensibility, Marianne tells Eleanor that Willoughby wishes he had married her (instead of marrying for money), but if he'd married Marianne, he'd have spent all his time wishing he'd married for money. Jane Austen figured out (and she lived in an Age that allowed her to do this) that it isn't enough just to be fascinated by a person. Elizabeth doesn't just love Darcy, she admires him, and for Elizabeth admiration is a necessary component for love.
So—the idea that a guy who loves being a priest and is very, very good at his job and who has fairly well sublimated his libido, will suddenly give it all up on a whim is nonsense.
But easy to write. Oh, sure, love conquers all. And just in case we doubt that, well, now the woman is dead so we will never find out will we?
On the opposite tack is Cop-Out 2