Only when clicked.
Some ads will also generate a lot more money than others, which are usually the targeted ones (as against Google just filling an ad slot). Ads work on a bidding system, so if a company really wants to be seen on here, it will bid a higher amount per click - and the highest bid wins.
It's therefore worth clicking on some ads from time to time, but bear in mind that Google is quite clever in determining a genuine click or not.. as well as any attempt to boost revenue by multiple clicks.
Google doesn't reveal all of its methods, and while some will be obvious (hitting F5 to refresh and clicking every add) others won't be - such as seeing if you click any links within an ad page, how long you stay, where you go next etc.
As such, some ad clicks may still not generate any revenue even if you think you're doing the site a favour by clicking on an ad...