Definition of Taking the Lord's Name in Vain
Well, that's a quote from the Ten Commandments: "Don't take the name of the Lord your God in vain." The idea of vanity (and I think the Hebrew carries this connotation) is "don't empty the name."
So it doesn't just refer to a certain tone of voice or a certain use of the word. It's dealing with God and speaking of God in a way that empties him of his significance.
This includes both throw-away words—like "God!" or "Jesus!"—as well as speaking about him in trifling and flippant ways. Not just swear ways but cheap ways, low and insignificant ways that just treat him like a commodity. And when you hear them you sense that there is no weight to that sentence, no corresponding emotion to that statement. It seems to have just been gutted.
God, Christ, the cross, the things he is, and the things he did are great, and they're weighty. And there's a certain corresponding demeanor of worship that should be there.
So I think taking the Lord's name in vain is more than "O my God!" or "Jesus Christ!" It is that plus more.
The positive way to look at it is to revere God, love God, delight in God, know God, fill up God with all that he is. And then, out of the abundance of the heart, the mouth will speak.
I think it is far better to take the commandments and not focus so much on the negative—that is "don't lie, don't commit adultery, don't steal, don't kill"—but rather focus on where those come from, and put the emphasis there. And here, "don't take his name in vain" would mean that you take his name in vain because he is empty to you. Your mind doesn't feel the weight and fullness of his glory.
So that's the key: vain is empty. Don't empty God of his weight and his glory. Fill it up rather than emptying it.
Additional Commentary on Exodus 20:7
Thou shall not take the name of the Lord God in vain
"Make use of the name Lord or God, or any other name and epithet of the divine Being, in a light and trifling way, without any show of reverence of him, and affection to him; whereas the name of God ought never to be mentioned but in a grave and serious manner, and with an awe of the greatness of his majesty upon the mind. The Targums of Onkelos and Jonathan restrain this to swearing by the name of the Lord; and so the Jewish writers generally interpret it either of swearing lightly, rashly, or falsely; and to this it may very well be extended, though not limited; and so forbids, as all profane oaths; imprecations, and curses by the name of God, which the mouths of wicked men are full of, so swearing by it in matters trivial, and of no importance; for swearing even by the name of the Lord ought not to be used but in matters of moment and consequence, for the confirmation of a thing, and putting an end to strife, and where a matter cannot be determined and decided without an appeal to God. And great care should be taken that a man swears to that which is true, and not false; for false swearing, or perjury, is a very grievous sin, and as it is strictly forbidden, it is severely punished by the Lord" - John Gills Exposition of the Bible
photo credit: Thinkstock