Here are places to check:
-System Preferences/Accounts/ -> click your account on the left. Click login items at the top and see if there are any items you wish not to start up on launch.
-In Google Chrome you can go to the settings area and it will show you extensions. If there is an ad extension, you will be able to disable it.
-In Safari, fo to the top of the screen, click Safari, choose Preferences, go to extensions and remove any items that may be linked inside that area.
-Go to the applications folder and see if there are any items that pertain to the malware/adware you might be experiencing.
Once you have gone through these items, restart and see if the issue is resolved. I would suspect an extension got installed unknowingly.