First of all for anybody to claim any piece of technology is impervious to hacks or viruses is simply ignorant.
Nobody here has claimed that the iPhone is impervious. It is true, though, that there are NO viruses currently capable of infecting an iPhone that has not been jailbroken. So, unless you think you know something that the entire security community does not, this isn't being caused by a virus.
I wish someone would come up with a solution at apple
There's nothing to solve. As I have already said, obnoxious ads can automatically open the App Store. JavaScript on a web site can automatically redirect the page, and by redirecting to an iTunes Store link, it will cause the App Store to open on an iOS device. For example, try clicking the following link:
itms://itunes.apple.com/us/app/youtube/id544007664?mt=8
[Edit: Hmm, looks like this forum does not allow itms: links, and it's not actually clickable. Instead, tap and hold on that line to select it, then tap Copy, then paste it into the address bar. This will result in iTunes opening first, then opening the App Store.]
This is all entirely normal. Those ads are obnoxious and inappropriate, but there is no malware involved. If you're visiting a site that has ads that keep popping the App Store open, there's an easy solution... quit visiting that site! (Ideally, let the site owner know why you're going to stop visiting, so that maybe they'll fix it by getting rid of those ads.)