Part of me feels like "bad behavior" is a defining feature of the internet. There are generally two ways to "handle" it, as long as it's relatively benign, depending on the situation.
Scenario 1: You are a participant in a community. (This can mean message boards, the comment area of a blog, a social networking site, etc.)
Ignore them. It's that simple. People will act out and troll for the sole purpose of getting a reaction. By reacting in any way, you are giving them exactly what they want - attention.
That said, depending on your temperment and experience, you can sometimes turn it around. Once I trolled a troll by, every time he mentioned my name I would *bask in the spotlight* and talk about how he was my biggest fan. I don't recommend this for most people or in most cases. I was actively trying to get him so angry that he broke the Terms of Service and got banned. That can very easily turn around to bite you.
Scenario 2: You own the domain, message board, blog, etc. that is being trolled.
Ban the person. Delete their comments.
You can control what happens on your own web areas. The First Amendment only applies to governmental restriction of speech - NOT a personal blog. If someone knocked on your door and started screaming hateful things when you opened it, would you let them or would you shut the door? Obviously you would shut the door. If they knocked again, chances are you wouldn't answer it. This is a similar situation, except neither of you has a physical presence.
* * *
Unfortunately, bad behavior doesn't end there. There are some people who have created mock websites that mimic someone being harassed or who have posed as an individual with the intention of defamation. When you get to that point, a line has been crossed and you should consider bringing your issue to a wider audience.
Internet law is still mostly undefined and jurisdiction is anyone's guess in many cases. You may decide to consult a lawyer or to enlist the attention of your local media outlets, but bring in some outside parties if you start to feel the situation move from a feeling of annoyance to a feeling of violation.