To give you an example of how it works, many of Nolo's competitors have purchased the keyword "willmaker," which Nolo has registered as a trademark for its estate planning software. If you type "willmaker" into Google, a series of ads from Nolo competitors will appear on the right side of the search results page. (As a practical matter, if you complain to Google, Google will usually remove ads that contain your company's trademarks within the text of the advertising.)
You're not the first person to complain about the keyword/trademark practice. The key issue, as with most trademark disputes, is whether consumers are confused and so far, U.S. courts have not found the practice to be confusing. For example, one court held that consumers were not confused by Google's sale of the keyword Geico, and another permitted Google's sale of the keywordRescue.com (PDF). The issue becomes more complex outside the U.S. In France, a court ruled against the practice in 2005. Of course, some trademarks may not trigger any ads. The Dear Rich staff is sad to report that when you type "Dear Rich" into your engine, not one advertiser appears.