  We study the statistics of near-extreme events of Brownian motion (BM) on the
time interval [0,t]. We focus on the density of states (DOS) near the maximum
\rho(r,t) which is the amount of time spent by the process at a distance r from
the maximum. We develop a path integral approach to study functionals of the
maximum of BM, which allows us to study the full probability density function
(PDF) of \rho(r,t) and obtain an explicit expression for the moments, \langle
[\rho(r,t)]^k \rangle, for arbitrary integer k. We also study near-extremes of
constrained BM, like the Brownian bridge. Finally we also present numerical
simulations to check our analytical results.
