You are correct that protons, being positively charged, repel each other due to the electrostatic force. This force is indeed much stronger than gravity. However, in certain conditions, it is possible to create and manipulate a beam of protons.
In particle accelerators, such as those used in high-energy physics experiments, protons can be accelerated to very high speeds using powerful electric and magnetic fields. These fields can overcome the electrostatic repulsion between protons and keep them confined within a narrow beam.
There are several techniques employed to control and focus proton beams. One method is to use a series of electric and magnetic fields that guide and accelerate the protons along a desired path. By carefully controlling the strengths and configurations of these fields, the protons can be made to travel in a well-defined beam.
Another important aspect is the concept of beam space charge neutralization. In a proton beam, the positively charged protons repel each other, leading to a spread of the beam and its ultimate divergence. To counteract this, negatively charged electrons can be introduced into the beam to neutralize the positive charge and reduce the mutual repulsion between protons. This technique helps in maintaining the beam's focus and stability.
It's important to note that in particle accelerators, the protons are typically accelerated to very high energies and confined within a vacuum, where their interaction with surrounding matter is minimal. This allows for the creation and control of proton beams despite the electrostatic repulsion between individual protons.