With regard to the fight at the end and how Kylo Ren was beaten:
Kylo Ren took a shot from Chewie's bowcaster. The wound slowed him down and made him less effective in combat, but one observation that someone made was that he was punching himself in the wound to make himself feel pain and anger, which would fuel his dark side power/connection. Still, the pain would be distracting.
Kylo is probably also feeling conflicted/distracted, maybe even guilty, from killing his father just a few minutes prior.
He's not very disciplined - you see this in his lightsaber-swinging tantrums. Compare this to Vader at the end of The Empire Strikes Back when the Millennium Falcon escapes - Vader simply walks off the bridge instead of erupting into a rage.
Basically, Kylo Ren isn't as effective as he could be; he can't concentrate and is injured.
Now, to Finn and Rey:
Finn has most likely had melee combat training, being an ex-stormtrooper, so he's probably handled melee weapons at some point. He's already handled the lightsaber, so he has a vague idea how to use it, if not handle it with appropriate technique. He may even have had some unseen practice messing around with it aboard the Falcon on the way to Starkiller base.
Rey has melee combat experience - she used the staff to good effect on Jakku, so she's agile and has good body control, and her use of a staff goes some way to helping her handle a sword. Plus, her newfound proficiency with the lightsaber was a way of showing her newfound Force ability.