  We develop a model for stochastic acceleration of electrons in solar flares.
As in several previous models, the electrons are accelerated by turbulent fast
magnetosonic waves ("fast waves") via transit-time-damping (TTD) interactions.
(In TTD interactions, fast waves act like moving magnetic mirrors that push the
electrons parallel or anti-parallel to the magnetic field). We also include the
effects of Coulomb collisions and the waves' parallel electric fields. Unlike
previous models, our model is two-dimensional in both momentum space and
wavenumber space and takes into account the anisotropy of the wave power
spectrum $F_k$ and electron distribution function $f_{\rm e}$. We use weak
turbulence theory and quasilinear theory to obtain a set of equations that
describes the coupled evolution of $F_k$ and $f_{\rm e}$. We solve these
equations numerically and find that the electron distribution function develops
a power-law-like non-thermal tail within a restricted range of energies $E\in
(E_{\rm nt}, E_{\rm max})$. We obtain approximate analytic expressions for
$E_{\rm nt}$ and $E_{\rm max}$, which describe how these minimum and maximum
energies depend upon parameters such as the electron number density and the
rate at which fast-wave energy is injected into the acceleration region at
large scales. We contrast our results with previous studies that assume that
$F_k$ and $f_{\rm e}$ are isotropic, and we compare one of our numerical
calculations with the time-dependent hard-x-ray spectrum observed during the
June 27, 1980 flare. In our numerical calculations, the electron energy spectra
are softer (steeper) than in models with isotropic $F_k$ and $f_{\rm e}$ and
closer to the values inferred from observations of solar flares.
