We propose a methodology for combining risk management with optimal planning of power production and trading based on probabilistic knowledge about future uncertainties such as demands and spot prices. Typically, such a joint optimization of risk and (expected) revenue yields additional overall efficiency. Our approach is based on stochastic optimization (stochastic programming) with a risk functional as objective. The latter maps an uncertain cash flow to a real number. In particular, we employ so-called polyhedral risk functionals which, though being non-linear mappings, preserve linearity structures of optimization problems. Therefore, these are favorable to the numerical tractability of the optimization problems. The class of polyhedral risk functionals contains well-known risk functionals such as Average-Value-at-Risk and expected polyhedral utility. Moreover, it is also capable to model different dynamic risk mitigation strategies.