I've done various volunteering activities before that were long term, but in the past couple months I've been volunteering each weekend at 5k races or local marathons. Each race is put on by a different group and benefits a different charity, so they don't really have anything in common except being races. How do I list these on my resume without putting each separate event?
First you want to ensure you're adding things relevant for a job you're looking at applying for. Always keep your resume tailored towards the position you're seeking. If you're looking for a programming job you need to identify the things that will carry over from the volunteer activities. Organizing a 5k run doesn't have much carry over. So things like the organization skills would help you out if you're looking at a Project Manager or Lead position, but a junior programmer not really. The best way to identify the carry over is to compare the job posting's requirements and nice to haves and go from there.
As far as where to put them? I'd lump them together at the end of the resume personally. They're not likely to have a large impact on your hiring but may help set you apart from an equally qualified candidate.
Linkedin says that 1/5 of employer choose also on the volunteer experence. So you should put in the resume for sure.
Actually i would write a separate section after "working experience" section and "education" section OR write that you partecipate in volunteer events in a summary(if you have one) at the start of your CV .