Re: What gives the "rightful" king the right?
Okay, coming right from a Political Theory professor...
Divine Right was a little later than the middle ages.
There are a couple concepts you need to know for the middle ages kings: Delegation, Fealty and the Body Politic.
Body Politic: The theory that a political system is like a body, and therefore requires a head (king) to function. You were born into a certain position (head vs., say, right small toenail), and you shouldn't really try to change that.
Delegation: In theory, God did not choose kings directly, but rather gave a little bit of sovereignty to every person. However, as the body politic requires a head, it was necessary for the people to delegate their sovereignty to a single person. At one point in time, everybody got together and decided that they needed a king, and that so-and-so should be king. In return, the king you chose would swear an oath of fealty.
In theory it was possible to take back the little bits of sovereignty you delegated, but practically this didn't do anything if you couldn't make it stick.
Fealty: This is an oath made by the king to protect and shepherd the people, in return for their obedience and service.
So that's it in a nutshell. It's kind of interesting, I think. Divine Right as a concept came about more towards the beginning of the Renaissance.
Edit: So the answer the question in the post is: The people. Ideally. Theoretically.
Usually it was the person with the power to make it stick.