Neutral beams are a valuable option to provide heat and current drive to a magnetically confined plasma. In addition they can be used as a diagnostics for the positive ion temperature and, in case of nuclear fusion reactions, for the amount of helium ash. In the case of ITER, stringent requirements are set on the acceptable beam divergence and aiming in order to propagate such beams up to the tokamak itself. Besides the well-known dependence of the beamlet optics on the beam energy and perveance, other important features affecting the optics are the ion spatial and velocity distribution at the plasma boundary facing the extractor, the so-called plasma meniscus. In a caesiated negative ion source, this distribution is influenced both by the birth energy of the negative ions and by the ion transport in the plasma itself. In this work we use a test particle code to investigate the negative ion transport up to the plasma meniscus and we use a standard ray-tracing code to trace the test particles that reached the meniscus inside the electrostatic accelerator. The coupling of the two codes is iterated up to numerical convergence. By this procedure, the angular distribution of the accelerated particles is found to be much more similar to the experimental ones than the one obtained by simple ray-tracing simulations.