Recent developments in the advertising industry have motivated changes in the way adinventory is purchased. Among the main innovations in this direction is the use of automated strategies deciding in real time the price they are willing to pay in order to expose a potential customer to a given message. In particular, once a strategic optimization layer determines the budget allocated to each audience and type of inventory, it remains the tactical problem of how to schedule the budget-delivery over time. This is the so called budget-pacing problem. In this article, we provide a framework to analyze this problem using variational calculus techniques, allowing to treat general settings and to obtain a simple characterization of the optimality conditions which leads to an implementation in the form of a feedback-control system. Our results are consistent with the fluid-limit approximation found in [4], which treats the problem using stochastic optimal control techniques.