The fast ions produced inside a mirror trap by neutral beam injection could form periodic short-lived density peaks near a turning point if the injection energy is properly modulated in time. Achievable parameters of thus formed fast ion bunches are analyzed in this paper. The theory is illustrated by estimates for the neutron source based on a gas-dynamic trap. The bunching of deuterium and tritium ions can produce periodic short bursts of neutron radiation with the intensity 1.5 times higher than the average level. The modulation of the neutron flux could extend the field of application for the neutron source. Also, the bunching could serve as a precise plasma diagnostics in mirror traps.