You don't want to block duplicate content with robots.txt. Google's guidelines say:
Google does not recommend blocking crawler access to duplicate content on your website, whether with a robots.txt file or other methods. If search engines can't crawl pages with duplicate content, they can't automatically detect that these URLs point to the same content and will therefore effectively have to treat them as separate, unique pages. A better solution is to allow search engines to crawl these URLs, but mark them as duplicates by using the
rel="canonical" link element, the URL parameter handling tool, or 301 redirects.
The rel canonical link tag is what you want to use. It is for cases where users need to be able to use various URLs but where search engines need to know which one in the correct one to index. Every page on your site should get a tag in the
<link rel="canonical" href="http://mainsite.example.com/this-page.html" />
As for Ads, the AdSense TOS says:
Publishers are not allowed to create multiple pages, sub-domains, or domains with substantially duplicate content.
The "duplicate content" is linked to the document that says that you can use rel canonical links to solve the problem. So implement the rel canonical links and you should be fine for both search and AdSense.