I'm with Windy - the way to change her behavior is to communicate, have consequences and be consistent. Sounds harsh in those words, but the same theory applies whether she's 1, 10 or 17.
So, in this case, say 'No spitting your food, food is for eating" (or "food is for your belly") when you start out, then give her one more warning the first time she does it, then calmly take away the food and all the utensils/bowls and take her down from the table. Make sure you say something about if she's spitting then she must be all done eating or not hungry or something. After the first time or two, I wouldn't even give her the second warning, just tell her when you start and then clear everything away the first time she does it.
She'll probably be upset and cry the first couple of times you do it, after all you're taking away something she's playing with, but she'll learn quickly that food is for eating, not for spitting out.
Don't worry, she won't go hungry. The little dickens understand us far more than they can communicate back, so she'll pick it up pretty quickly. The key is to stay calm and deal with it the same way each time, then she learns what to expect will happen next (after she spits). When she does eat well, you can praise her and make a show of checking her mouth and belly to see 'where it went'. = ) Or you can say something like "don't eat MY cheerios (or whatever food)" and pretend you want it when you give it to her, and she'll either race to gobble it up or try to give it to you (sometimes it can backfire, if they are being generous or don't like the food. = ) Make it a little fun and the learning process will go faster. My 4 1/2 year old still tells me at the dinner table "say don't eat it, Mommy" just because she likes the fun of it when we do that - she knows fully well that I want her to eat what's on her plate.