You say it when someone has something you want and that person dangles it in front of you without giving it to you. This could be literal or metaphorical. For example, someone has a piece of information that you really want to know. Instead of telling you the answer directly, that person beats around the bush, telling you tidbits and nonessential details. More concretely, say you want to know where your boyfriend was last night, and your best friend Kate says, "Oh, it was so shocking to see him there. I just couldn't believe my eyes. I had to rub my eyes to check if I really recognized the right guy! I also had to pinch myself to make sure I wasn't dreaming," etc., etc., etc. Finally you say, "stop toying with me, come on, tell me where he was!"
As for the difference between "lying" and "tricking," the former is strictly saying something untrue verbally. The second (trick) encompasses multiple methods (verbal and non-verbal) that entail using a ruse to make people believe something untrue.