A method to hedge variable annuities in the presence of basis risk is developed. A regime-switching model is considered for the dynamics of market assets. The approach is based on a local optimization of risk and is therefore very tractable and flexible. The local optimization criterion is itself optimized to minimize capital requirements associated with the variable annuity policy, the latter being quantified by the Conditional Value-at-Risk (CVaR) risk metric. In comparison to benchmarks, our method is successful in simultaneously reducing capital requirements and increasing profitability. Indeed the proposed local hedging scheme benefits from a higher exposure to equity risk and from time diversification of risk to earn excess return and facilitate the accumulation of capital. A robust version of the hedging strategies addressing model risk and parameter uncertainty is also provided.