There is a fine line between flirting and sexual harassment. If the behavior continues and you believe you are being sexually harassed, confront the perpetrator and tell him or her (yes, women can sexually harass people, too) in clear terms to stop. Do not mince words or try to spare their feelings. More often than not, the person will backpedal by telling you they were "only fooling around and didn't mean anything serious" or were "just kidding." Occasionally men may say something like, "What's wrong with you? You don't like that? You must be a lesbian." Regardless of the excuse, repeat your message that you consider the behavior to be sexual harassment and you want it to stop.
Confronting a perpetrator who outranks you can be more difficult. Plan what you will say and stick with it. As awkward as it may seem, the problem will not go away by your ignoring it. In fact, it is likely to get worse, if the individual assumes that you like the attention or that he has you intimidated.
Timing is everything. Your point must be made shortly, if not immediately, after the behavior occurs, so there is no mistaking what you are talking about. Although you are the victim, this is not the time for a loud or emotional tone of voice. Keep your voice level and make your point unmistakable. If your voice is shaky or you are in tears, the bully who is harassing you will know that they have you intimidated. Don't let them win.
Although there are other ways to deal with unwanted flirting, a direct approach is the most effective. You can go to the perpetrator's supervisor and tell him about the problem or you can talk to an equal opportunity advisor. This may solve the problem. However, it will almost always elicit the response from the perpetrator, "Well, she (or he) never said anything. How was I to know they didn't like it?"
For more information on this subject read Move to the Front and Women on Your Team by Colonel Jo B. Rusin, US Army Retired.