Expected payoff vs. payout for expected outcome

Someone pointed out this puzzle in Kahneman's Thinking, Fast and Slow. I paraphrase.

A game rewards participants based on how long it takes to obtain the first heads in a toss of a fair coin. If the first toss results in heads, then the player gets reward $r(1) = \$2$. If the first heads appears only in the second toss, then the player gets$r(2) = \$4$. And $r(3) = \$8$if the first heads appears on the third toss, and so on. How highly can one price the ticket before this game stops making sense for a player? It seems to me that the solution depends on what I choose for the random variable. If I choose the payoff as the random variable$X_P$, then the expected reward is the expected payoff, i.e.$E[\mathsf{reward}] = E[X_P] = \Sigma_{i=1}^{\infty} (\frac{1}{2})^i \times r(i) = \frac{1}{2}\times\$2 + \frac{1}{4}\times\$4 + \ldots = \infty$. This is the approach discussed in the book. However, if I choose as random variable$X_N$the number of tosses it takes to obtain the first heads, then my expected reward is the reward associated with the expectation$E[X_N]$of the number of tosses leading up to and including the first heads, i.e.$E[\mathsf{reward}] = r(E[X_N]) = r(2) = \$4$ [cf. this].