A modeling investigation was performed to choose moderator material and size for creating optimal epithermal neutron beams for BNCT based on a proton accelerator and the 7 Li(p,n) 7 Be reaction as a neutrons source. An optimal configuration is suggested for the beam shaping assembly made from polytetrafluoroethylene and magnesium fluorine. Results of calculation were experimentally tested and are in good agreement with measurements.