  Let $\Omega$ be a $m$-hyperconvex domain of $\mathbb{C}^n$ and $\beta$ be the
standard K\"{a}hler form in $\mathbb{C}^n$. We introduce finite energy classes
of $m$-subharmonic functions of Cegrell type, $\mathcal{E}_m^p, p>0$ and
$\mathcal{F}_m$. Using a variational method we show that the degenerate complex
Hessian equation $(dd^c\varphi)^m\wedge \beta^{n-m}=\mu$ has a unique solution
in $\mathcal{E}_m^1$ if and only if every function in $\mathcal{E}_m^1$ is
integrable with respect to $\mu$. If $\mu$ has finite total mass and does not
charge $m$-polar sets, then the equation has a unique solution in
$\mathcal{F}_m$.
