A linear accelerator is built with several drift tubes that increase in length, at either end of each tube are electrodes that provide an alternating current. As a proton is a positively charged particle it is accelerated by the negative electric field. As the proton is travelling in the tube the alternating potential difference causes the electrodes to switch charge, this means that the tube the proton is leaving is now positively charged so repels it and the tube the proton is approaching is now negatively charged and therefore attracts it, causing further acceleration. This process repeats through all of the drift tubes.
The drift tubes increase in size so that as the proton accelerates it travels further through each tube keeping in time with the oscillation of the current.The potential difference must also alternate at a constant frequency so that the time the proton spends in each tube is the same.