The invention relates to RF voltage-operated ion guides based on stacked apertured diaphragms. The invention provides ion guides consisting of diaphragm stacks that permit the ion beam to be shaped in cross-section so that it corresponds to the acceptance profile of the subsequent section of the device, therefore yielding optimal ion transmission. For this purpose, at least some of the diaphragms in the diaphragm stacks do not have circular openings, but instead have openings which shape the cross section of the emerging ion beam in the desired manner. It is possible, for instance, to obtain elliptical beam cross sections, divided beams or beams focused to the shape of a fine thread at the output of the diaphragm stacks.