This happens when you download an ad funded program. If you downloaded any sort of program from, for instance CNET there are options prior to the initial setup referring to installing toolbars, spam programs, etc. You probably accidentally agreed to something you didn't mean to, or you may have just visited a malicious site.
To get rid of it do as Boohbah said. I recommend downloading an antivirus software like Avast that provides web protection.
Or do as I do, download Google Chrome and install adblock from the Chrome store. Lifesaver.
If you notice that you have unwanted toolbars visit your control panel, look for the name of the toolbar and simply uninstall it.