Set-up:
Give your friend three dice. Turn your back and ask your friend to roll the dice. Without seeing the result, ask your friend to sum the total of the three dice.
Next - again, you are not looking - ask that one of the three dice are turned upside down. Ask that your friend add that result to the prior sum. For example, if the outcome of the first roll was one, two, three, the sum would be six. Your friend chooses the die showing one and flips it over to expose a six and adds this to the sum so now the sum is twelve.
Next, ask your friend to roll the chosen die again and add that result to the sum. For example, if the re-rolled die results in a three, the new sum is fifteen.
Now, have your friend show you the three dice in their present condition (three dice showing two, three, and three). You don't know which die was re-rolled but you quickly announce the final sum is fifteen.
Your instructions:
When your friend shows you the final outcome of the three dice, add those three dice results together and simply add seven. In the example given, the final result was two-three-three which totals eight; add seven, the total is fifteen.
How does this work?
Opposite sides of a six-faced die always add up to seven. The one and six are on opposite sides, as are the two and five, and the three and four.
While you don't know which die was re-rolled, you know that the die had two sides added to the running sum that add up to seven. The other two dice were not changed so their numbers are shown to you at the end. The re-rolled die, even though you don't know which one it was, is shown to you in the final result. The only result missing is the original result of the chosen die and the it's opposite side. But since these two numbers always add up to seven, you can assume that seven has to be added to the result of the sum of the three dice shown to you to know your friend's final running total.
A visual demonstration of this trick is presented by Numberphile: Three Dice Trick - Numberphile - Bing video