1. A playful act of flirting usually done by women to entice a male. It is a cat and mouse game to see how far the male will go to get the girl.
2. The malicious act to cause hurt and anger. A synonym would be fucking with you. This act is entirely psychological where you literally get inside the person's head and intentionally do harm. What makes this act perverse is that the one that is causing the harm usually finds spiteful pleasure in what he/she is doing.
The difference between the two is the intentions; the first example's intention is to find out if a relationship is possible. The second example's intention is to sadistically cause harm by using your mind on another.
John Doe 1: Mary keeps flirting with me but then when I ask her what she is doing later tonight she always has plans.
John Doe 2: She's toying with you mate.
Jane Doe 1: I yelled and screamed at frank for ten minutes and you know what he did? He just sat their smiling back at me! That little twerp he did nothing!
John Doe 1: He was enjoying you waste your time yelling at him, Frank was toying with you. I think you should move on.