As shown below, I have 2 nested spheres, each with a different material (inner = "1", outer = "2"). Ultimately, I need to select the inner sphere (material "1") via python scripting.
I've found a number of ways to select (or make active) one of the spheres. However, even though Blender says that it's selecting the correct sphere (indicated by orange line around center sphere), I don't believe it's active -- adding a modifier applies it to the outer sphere instead. That, and the material properties show the properties of the outer sphere.