How old are they?
What sort of skills are they doing?
We do a lot of 'mid body' or 'core' conditioning - hollow holds and rockers - we also do this with the gymnasts lying on their sides. Lots of work on a gym ball.
Teach the gymnasts to grip the beam with their toes.
Ensure their hips are always facing forwards during elements.
Have consequences for falling off and rewards for sticking.
Every session, my gymnasts have to stick 5 of each of the skills that they are currently competing and then move on to the skills they are working on for next season. Currently that looks like this:
5 cartwheels, 5 backward walkovers, 5 bhs, 5 full spins, 5 split jumps or sissones.
When they are learning skills they have to stick 10 on the low padded beam, then remove a mat, stick 10, remove a mat etc etc.
If they don't fight to stay on in their warm up, they don't get to move on to their new skills.
When they were younger they had a sticker chart and 'sticking beam' would be one of the targets! Now they know that if they don't get their new skills they won't be able to do their competitions next season so they are motivated to try hard.
It takes a long time to get consistent on beam and I firmly believe that repetition is the key!
Failing that, glue them!