Different proteins have different expression levels. It is unclear to what extent these expression levels are optimized to their environment. Evolutionary theories suggest that protein expression levels maximize fitness, but the fitness as a function of protein level has seldom been directly measured. To address this, we studied the lac system of Escherichia coli, which allows the cell to use the sugar lactose for growth. We experimentally measured the growth burden due to production and maintenance of the Lac proteins (cost), as well as the growth advantage (benefit) conferred by the Lac proteins when lactose is present. The fitness function, given by the difference between the benefit and the cost, predicts that for each lactose environment there exists an optimal Lac expression level that maximizes growth rate. We then performed serial dilution evolution experiments at different lactose concentrations. In a few hundred generations, cells evolved to reach the predicted optimal expression levels. Thus, protein expression from the lac operon seems to be a solution of a cost-benefit optimization problem, and can be rapidly tuned by evolution to function optimally in new environments.