Context : The abundances of interstellar CH ^ { + } and SH ^ { + } are not well understood as their most likely formation channels are highly endothermic . Several mechanisms have been proposed to overcome the high activation barriers , including shocks , turbulence , and H _ { 2 } vibrational excitation . Aims : Using data from the Herschel Space Observatory , we studied the formation of ions , in particular CH ^ { + } and SH ^ { + } in a typical high UV-illumination warm and dense photon-dominated region ( PDR ) , the Orion Bar . Methods : The HIFI instrument on board Herschel provides velocity-resolved line profiles of CH ^ { + } 1-0 and 2-1 and three hyperfine transitions of SH ^ { + } 1 _ { 2 } -0 _ { 1 } . The PACS instrument provides information on the excitation and spatial distribution of CH ^ { + } by extending the observed CH ^ { + } transitions up to J = 6 - 5 . We compared the observed line intensities to the predictions of radiative transfer and PDR codes . Results : All CH ^ { + } , SH ^ { + } , and CF ^ { + } lines analyzed in this paper are seen in emission . The widths of the CH ^ { + } 2-1 and 1-0 transitions are of \sim 5 km s ^ { -1 } , significantly broader than the typical width of dense gas tracers in the Orion Bar ( \sim 2-3 km s ^ { -1 } ) and are comparable to the width of species that trace the interclump medium such as C ^ { + } and HF . The detected SH ^ { + } transitions are narrower compared to CH ^ { + } and have line widths of \sim 3 km s ^ { -1 } , indicating that SH ^ { + } emission mainly originates in denser condensations . Non-LTE radiative transfer models show that electron collisions affect the excitation of CH ^ { + } and SH ^ { + } and that reactive collisions need to be taken into account to calculate the excitation of CH ^ { + } . Comparison to PDR models shows that CH ^ { + } and SH ^ { + } are tracers of the warm surface region ( A _ { V } < 1.5 ) of the PDR with temperatures between 500 and 1000 K. We have also detected the 5-4 transition of CF ^ { + } at a width of \sim 1.9 km s ^ { -1 } , consistent with the width of dense gas tracers . The intensity of the CF ^ { + } 5-4 transition is consistent with previous observations of lower - J transitions toward the Orion Bar . Conclusions : An analytic approximation and a numerical comparison to PDR models indicate that the internal vibrational energy of H _ { 2 } can explain the formation of CH ^ { + } for typical physical conditions in the Orion Bar near the ionization front . The formation of SH ^ { + } is also likely to be explained by H _ { 2 } vibrational excitation . The abundance ratios of CH ^ { + } and SH ^ { + } trace the destruction paths of these ions , and indirectly , the ratios of H , H _ { 2 } , and electron abundances as a function of depth into the cloud .