We study the problem of an Internet advertising firm that wishes to maximize advertisement (ad) revenue, subject to click-through rate restrictions imposed by the publisher who controls the website on which the ads are displayed. The problem is directly motivated by Chitika, an Internet advertising firm that operates in the Boston area. Chitika contracts with publishers to place relevant ads over a specified period, usually one month, on publisher websites. We develop a predictive model of a visitor clicking on a given ad. Using this prediction of the probability of a click, we develop a decision model that uses a varying threshold to decide whether or not to show an ad to the visitor. We vary the threshold depending on (1) the cumulative number of times an ad has been shown and (2) the cumulative number of clicks on the ad. The decision model's objective is to maximize the advertising firm's revenue subject to a click-through rate constraint. The implemented models work in real time in Chitika's advertising network. We also discuss the implementation challenges and business impact.