Intuition for the last step in Serre's proof of the three-squares theorem Serre's A Course in Arithmetic gives essentially the following proof of the three-squares theorem, which says that an integer $a$ is the sum of three squares if and only if it is not of the form $4^m (8n + 7)$ :  first one shows that the condition is necessary, which is straightforward.  To show it is sufficient, a lemma of Davenport and Cassels, using Hasse-Minkowski, shows that $a$ is the sum of three rational squares.  Then something magical happens:
Let $C$ denote the circle $x^2 + y^2 + z^2 = a$.  We are given a rational point $p$ on this circle.  Round the coordinates of $p$ to the closest integer point $q$, then draw the line through $p$ and $q$, which intersects $C$ at a rational point $p'$.  Round the coordinates of $p'$ to the closest integer point $q'$, and repeat this process.  A straightforward calculation shows that the least common multiple of the denominators of the points $p'$, $p''$, ... are strictly decreasing, so this process terminates at an integer point on $C$.
Bjorn Poonen, after presenting this proof in class, remarked that he had no intuition for why this should work.  Does anyone have a reply? 
Edit:  Let me suggest a possible reformulation of the question as follows.  Complete the analogy:  Hensel's lemma is to Newton's method as this technique is to _____________________.
 A: A few days ago Serre told me about some modest improvements to the proof, based on Weil's book Number theory: an approach through history from Hammurapi to Legendre and on a 1998 letter from Deligne to Serre; I will paraphrase these below.
According to Weil (p. 292), the ``magical'' argument is due to an amateur mathematican: L. Aubry, Sphinxe-Oedipe 7 (1912), 81--84.  Here is a generalization that allows for a clearer proof.
Lemma: Let $f = f_2+f_1+f_0 \in \mathbf{Z}[x_1,\ldots,x_n]$, where $f_i$ is homogeneous of degree $i$.  Suppose that for every $x \in \mathbf{Q}^n-\mathbf{Z}^n$, there exists $y \in \mathbf{Z}^n$ such that $0<|f_2(x-y)|<1$.  If $f$ has a zero in $\mathbf{Q}^n$, then it has a zero in $\mathbf{Z}^n$.
Proof: If $x=(x_1,\ldots,x_n) \in \mathbf{Q}^n$, let $\operatorname{den}(x)$ denote the lcm of the denominators of the $x_i$.  By iteration, the following claim suffices: If $x \in \mathbf{Q}^n - \mathbf{Z}^n$ and $y \in \mathbf{Z}^n$ satisfy $0<|f_2(x-y)|<1$, and the line $L$ through $x$ and $y$ intersects $f=0$ in $x,x'$, then $\operatorname{den}(x')<\operatorname{den}(x)$.  By an affine change of variable over $\mathbf{Z}$, we may assume that $y$ is $0$ and that $L$ is the $x_1$-axis.  By restricting to $L$, we reduce to proving the following: given $f(t)=At^2+Bt+C \in \mathbf{Z}[t]$ with zeros $x,x' \in \mathbf{Q}$ such that $0<|Ax^2|<1$, we have $\operatorname{den}(x')<\operatorname{den}(x)$.  Proof: Factor $f$ over $\mathbf{Z}$ as $E(Dt-N)(D't-N')$ with $x=N/D$ and $x'=N'/D'$ in lowest terms.  Then $0<|Ax^2|<1$ implies $0<|A|<D^2$.  On the other hand, $DD'$ divides $EDD'=A$, so $DD' \le |A| < D^2$.  Hence $D'<D$.
A: Okay, this is a crazy line of thought even for me, but there are a lot of number-theoretic or combinatorial algorithms where the proof of correctness proceeds along essentially the same lines. A solution is shown to be equivalent to some parameter equalling 1 (or 0). The parameter can usually take only integer values at any point in the set of potential solutions. We then apply an iterative algorithm and show that at each iteration, if we don't already have a solution, the parameter strictly decreases. Then the algorithm must eventually terminate at a solution.
Examples: The greedy algorithm for Egyptian fraction representations, and (kind of) the Gale-Shapley stable marriage algorithm.
I don't really know enough in this area to speak with any kind of certainty, but you're looking for a real-valued analogue of something like this -- I suspect it's probably linear programming, or some generalization thereof. Maybe interior point methods? 
A: The intuition for this method of passing from a rational solution to an integral solution seems pretty simple to me: passing from a rational solution to a nearby integral point (not necessarily a solution) is passing to a point whose denominators are 1, so you can anticipate that when you intersect the line through your rational solution and the nearby integral point with whatever curve or surface contains your solutions, the second intersection point on that line will have denominators that have moved closer to 1.  That is, connecting a rational solution with some integral point will spit out a new solution whose denominators are somewhere between the denominators of your solution and the denominators of the integral point you used to produce the line.
Of course intuition is one thing and checking the details is another: you choose the integral point nearby and the math has to work out to show the denominators really get smaller in the second solution you produce.  For instance, this method of proving the 3-square theorem goes through without a problem for a similar 2-square theorem (if an integer is a sum of two rational squares than it's a sum of two integral squares by the same method, replacing the sphere x^2 + y^2 + z^2 = a with the circle x^2 + y^2 = a).  But this intuitive way of creating an integral solution from a rational solution breaks down if you apply it to the 4-square theorem: the inequalities in the proof just barely fail to work (sort of like doing division with remainder and finding the remainder is as big as the divisor instead of smaller). 
The intuition also breaks down if you slightly change the expression x^2 + y^2 (sticking to two variables).  Consider x^2 + 82y^2 = 2 and the rational solution (4/7,1/7). Its nearest integral point in the plane is (1,0), and the line through these intersects the ellipse in (16/13,-1/13), so the denominator has gone up. There actually are no integral solutions to x^2 + 82y^2 = 2.  Or if we take x^3 + y^3 = 13 and the rational solution (2/3,7/3), its nearest integral point in the plane is (1,2), the line through these meets the curve again in (7/3,2/3), whose nearest integral point in the plane is (2,1), the line through them meets the curve in (2/3,7/3),...
A few years ago when I was giving some lectures on the method of descent, I worked out some examples of this geometric "three-square" theorem (start with an equation a = x^2 + y^2 + z^2 where a is an integer and x, y, and z are rational and produce in a few steps an equation where x, y, and z are integral) and I noticed in my initial examples that the denominators in each new step did not merely drop, but dropped as factors, e.g., if the common denominator at first was 15 then at the next step it was 5 and then 1.  Maybe the denominators always decreas through factors like this?  Nope, eventually I found a case where they don't:  if you start with 
13 = (18/11)^2 + (15/11)^2 + (32/11)^2
then the integral point nearest (18/11,15/11,32/11) is (2,1,3) and the line through these two points meets the sphere 13 = x^2 + y^2 + z^2 in the new point (2/3,7/3,8/3), so the denominator has fallen from 11 to 3, which is not a factor.  (At the next step you will terminate in the integral solution (0,3,2).)
A: Perhaps not what you're looking for, but superficially this looks like a minimization procedure under constraint: rounding to the closest integer point means minimizing the Euclidean distance to the integer lattice, then the straight line to C means projecting back on the constraint manifold. (I'll try to see which one procedure in particular, could be simply gradient descent.)
A: I have never understood this proof either. What in my mind makes it very odd is that a very similar argument can sometimes be used to prove in some sense the exact opposite---that certain equations have solutions with denominators as big as you like. For example the proof in Cassels' "elliptic curves" book that x^3+y^3=9 has infinitely many rational solutions goes like this: "find one point (e.g. (2,1)). Now draw the line tangent to the curve through that point, giving a new point (the 3rd point of intersection of the line and the curve), compute the denominators of the new point and observe that they are bigger than those of the old curve. Hence doing this procedure infinitely often produces infinitely many points". You're doing the "new points from old" trick but this time the denominators are getting provably worse rather than provably better.
