We study a service facility modeled as a queueing system with finite or infinite capacity. Arriving customers enter if there is room in the facility and if they are willing to pay the price posted by the service provider. Customers belong to one of a finite number of classes that have different willingnesses-to-pay. Moreover, there is a penalty for congestion in the facility in the form of state-dependent holding costs. The service provider may advertise class-specific prices that may fluctuate over time. We show the existence of a unique optimal stationary pricing policy in a continuous and unbounded action space that maximizes the long-run average profit per unit time. We determine an expression for this policy under certain conditions. We also analyze the structure and the properties of this policy.