I do programming and computer security work for a living and have seen 2 different scenarios - might be malware, might a script on the website that is highlighting advertising keywords. Either one is a pain and slows down your browser. Malware can be scanned for and fixed, the latter is something that you just have to deal with unless you make some big changes to how you use the Internet.
The guys up top that are on Linux and/or Mac OS have the right idea, those operating systems are harder to crack or infect with malware. Not that it can't happen, just that they aren't as big of a target as good ole Windows.
There is one pretty good way to stop all that from slowing you down and infecting you, you can disable Javascript and plugins in your browser. That will stop most of the issues, but it will also drastically affect the way things look and act, sometimes making certain websites not work at all. One of those situations where you have to pick your poison.