We analyze a dynamic auction, in which a seller with C units to sell faces a sequence of buyers separated into T time periods. Each group of buyers has independent, private values for a single unit. Buyers compete directly against each other within a period, as in a traditional auction, and indirectly with buyers in other periods through the opportunity cost of capacity assessed by the seller. The number of buyers in each period, as well as the individual buyers' valuations, are random. The model is a variation of the traditional single-leg, multiperiod revenue management problem, in which consumers act strategically and bid for units of a fixed capacity over time. For this setting, we prove that dynamic variants of the first-price and second-price auction mechanisms maximize the seller's expected revenue. We also show explicitly how to compute and implement these optimal auctions. The optimal auctions are then compared to a traditional revenue management mechanism – in which list prices are used in each period together with capacity controls – and to a simple auction heuristic that consists of allocating units to each period and running a sequence of standard, multiunit auctions with fixed reserve prices in each period. The traditional revenue management mechanism is proven to be optimal in the limiting cases when there is at most one buyer per period, when capacity is not constraining, and asymptotically when the number of buyers and the capacity increases. The optimal auction significantly outperforms both suboptimal mechanisms when there are a moderate number of periods, capacity is constrained, and the total volume of sales is not too large. The benefit also increases when variability in the dispersion in buyers' valuations or in the number of buyers per period increases.