Perform a search to find all the messages you want to select. (You can use is:unread too)
Click select all
You will see that above the first item in the list there is a banner that says something like: All 50 conversations on this page are selected. Select all # conversations in "..."; click that link.
You can also do this with a filter, by creating the filter, choosing to mark the messages as read, and then choosing to apply the filter to the matching conversations. Then simply delete the filter.
Search for string before:date (date in format yyyy-mm-dd) and then choose More > Mark all as read.
Watch out: This will select also emails from this date! I.e. before:2012-07-12 will select email received before 12 July 2012, but also emails received on 12 July 2012.
Best Answer
There is a step-by-step solution here, and it works:
http://www.zdnet.com/blog/btl/how-to-mark-all-unread-emails-as-read-in-gmail-and-more/80754
is:unread
select
" button, then choose "all
."Select all conversations that match this search
."Mark as read
."