I already know that if you take multiple "acts" while in a threatened square, you provoke multiple attacks of opportunity (for example, if you drink a potion and then move out of a threatened square) from creatures that can make multiple attacks of opportunity.
Rules Compendium (page 18)
Moving out of a threatened square can provoke attacks of opportunity, as can being in a threatened square while performing an act that requires focused attention.
Rules Compendium (page 19)
Some abilities allow you to make more than one attack of opportunity per round. Most such abilities, unless they say otherwise, don’t let you make more than one attack for a given opportunity. If the same opponent provokes two attacks of opportunity from you, however, you could make two separate attacks of opportunity. Each provoking act represents a different opportunity.
What I want to know is, does a single "action" that involves multiple "acts" that provoke an AoO actually provoke multiple AoOs from the same creature?
For example, if I'm threatened by a creature that can make multiple AoOs in a round (such as through the Combat Reflexes feat) and I cast a spell (with a casting time longer than a swift action) that also requires a ranged attack (such as with the Scorching Ray spell), does that creature get to make two AoOs against me? If the spell requires multiple ranged attacks (again, like with Scorching Ray), do each of those ranged attacks provoke yet another AoO?
I would think we should first ask whether the ranged attack from such a spell is part of the same "opportunity" as the casting of that spell. If so, I would think the answer to my initial question is "no". That is, that the entire opportunity either "provokes" or "doesn't provoke" as a set of boolean "ORs". I guess the key issue then is to ask what defines an "opportunity". Logic would imply that an "opportunity" is anything that happens at a specific instant in time, but I've searched the Rules Compendium and the June 2008 Official FAQ but I can't seem to find anything that unambiguously defines an "opportunity" (please use quotes from specific sources).
Originally I thought that you could define an "opportunity" as a specific action (such as a standard action), but you can't really define it that way because while that might work for standard actions a full attack (a full-round action) can involve multiple "acts" that reasonably might provoke multiple AoOs (such as making multiple attacks with a ranged weapon).