make money visiting websites

How exactly is the procedure by which websites e.g Yahoo make money by people only visiting their websites?
Is it by the amount of people that visit the site?I know i do not pay yahoo any money,so how?
They make money majorly on 3 ways
1. Revenue from Ad Impressions
whenever you visit any page on yahoo,
you get to see some ads which is charged
based on how many people have seen it
(how many pages it got served with)
so just visiting any page with ads is enough
to generate money for them.
2. Revenue from Ad Clicks
Whenever you visit any yahoo page
and then click on any of the ads in the page.
This is major revenue source considering
millions of people visiting the site and even if
less percentage of people click on ads
3. Revenue from Premium services
any service which is free will have a premium version
where you pay for the service and get some
extra benefits compared to free version.
eg: premium mail doesn’t have any ad
user pays a monthly/yearly fee for the service
Making Money online by visiting websites! Really works