The formation of the antihydrogen beam in the AEGIS experiment through the use of inhomogeneous electric fields is discussed and simulation results including the geometry of the apparatus and realistic hypothesis about the antihydrogen initial conditions are shown. The resulting velocity distribution matches the requirements of the gravity experiment. In particular it is shown that the inhomogeneous electric fields provide radial cooling of the beam during the acceleration.