Sounds like you got either a virus, malware, or a bad app that is ad crazy. What did you install recently? Whatever it was, I would suggest uninstalling it and then restart (turn it off and back on) the phone. Should that not work, and the ads continue, then you need to check the device for malware and viruses.
As a last resort, should nothing else resolve this, then I would back up all your personal stuff (files, contacts, etc., just not apps) to a cloud account, google account or a computer and then do a "Hard Reset" of the phone.
NOTE: Doing this will clear 'all' the data on your phone, so it is suggested you not choose this option unless you have to, or aren't worried about losing anything on the phone.
Be sure you back up any...