Any charge (elecgtron, proton, ion) moving through a magnetic field will experience a force that is at right angles to its motion and in a direction that depends on the magnetic field vector. This will produce a spiral motion (or circular if the charge is moving at right angles to the field). I would not have called it "random" motion because it is determined by the conditions but, as they may not be known accurately then the motion may be hard to predict. They spiral left or right, depending on the sign of the charge and the radius of the spiral depends on their mass and strength of field.
Ultra fast particles from outer space tend to spiral around the Earth's magnetic field lines. This helps to protect us from their effects because they follow much longer paths than if they were coming in 'direct' as they collide with many more air molecules and lose most of their energy before they get to the ground. (Useful)
Neutral particles are not affected by electromagnetic fields and tend to just plough on until they actually hit something. Neutrons go straight through atoms, even, unless they find the nucleus - which is why they are so dangerous; you need a lot of screening to be safe from them.