There are two basic methods:-
1-Flat rate offer, in this scenario you get paid a flat fee and despite what the book or article does afterwards, you have been paid for your work.
2-Incremental payments based on sales or reads. Whereas the possibility of a greater income is seen as an incentive, you are at the whim of the buyers or readers.
A good example is Star Wars, when the film was over the crew were offered the choice, many chose the flat fee; bills to pay and life to lead taking precedence over the possible greater good.
Sir Alec Guinness chose to be paid a percentage fee, meaning every time the film was shown or a toy was sold, he got a payment-even if it was small. Now, think of all the toys and showings of Star Wars since its inception.
This is all well and good if you are a big name, the chance your name will carry some weight is great and from that you can gauge the outcome, most books by Stephen King, Clive Barker, Clive Cussler and other prominent writers sell well.
From my point of view, I would rather take a small payment, cash in hand. My name holds no power, so putting my fate in the hands of readers and buyers is not (!) a viable option, as was shown by sales on Amazon Vs articles on Yahoo.
Amazon for a year £10.86
Articles on Yahoo this year £40