  We develop a variational approach to the vanishing discount problem for fully
nonlinear, degenerate elliptic, partial differential equations. Under mild
assumptions, we introduce viscosity Mather measures for such partial
differential equations, which are natural extensions of the Mather measures.
Using the viscosity Mather measures, we prove that the whole family of
solutions $v^\lambda$ of the discount problem with the factor $\lambda>0$
converges to a solution of the ergodic problem as $\lambda \to 0$.
