x^2+ y^2+ z^2= 2az when x^2+ y^2+ z^2- 2az= 0. We can complete the square by adding a^2 to both sides: x^2+ y^2+ z^2- 2az+ a^2= x^2+ y^2+ (z- a)^2= a^2. That is a sphere with center at (0, 0, a) and radius a. x^2+ y^2+ z^2= a^2 is, of course, a sphere with center at (0 0, 0) and radius a. The two spheres intersect when (z- a)^2 - z^2= z^2- 2az+ a^2- z^2= a^2- 2az= 0 or z= a/2, in which case x^2+ y^2+ z^2= x^2+ y^2+ a^2/4= a^2 or x^2+ y^2= 3a^2/4. That is, the intersection is a circle in the z= a/2 plane with center at (0, 0, a/2) and radius a\sqrt{3}/2.
In terms of spherical coordinates, each point on that circle of intersection has \rho= a and \theta= arcsin(\sqrt{3}/2)= \pi/6
The integral, then, should be done in two parts: For the first, \theta goes from 0 to \pi/6 and, for each \theta, \rho goes to the "upper sphere", [math]x^2+ y^2+ z^2= a^2[/math], from 0 to a.
For the second part, \theta goes from \pi/6 to \pi/2 and, for each \theta, \rho goes from 0 to the "lower" sphere x^2+ y^2+ z^2= 2az which in polar coordinates is \rho^2= 2a\rho cos(\theta). That is, for each \theta, \rho goes from 0 to 2a cos(\theta). (Note that when \theta= \pi/6, cos(\theta)= 1/2 so that \rho= a.)
\phi goes from 0 to 2\pi for both integrals.
(In order to be consistent with the original post, I have used "engineering" notation of spherical coordinates in which \theta is the "co-latitude" and \phi is the "longitude" rather than "mathematics" notation in which the two Greek letters are reversed. I have used \rho rather than "r" because that is the convention in either system.)