It's in the rules you quoted yourself. You only flank while making melee attacks. While you would still provide a flanking bonus to others, a ranged attack with a ray would not count as flanking and therefore be unable to get the bonuses from sneak attack unless the target were denied his dexterity bonus.
Since activating a wand of scorching ray is a standard action, the rogue might try to use his melee weapon to feint. He might even make a 5ft step after feinting to avoid the attack of opportunity for ranged attacks.
Still pathetic and expensive.
You seem to be right about the Zen Archer, however.
This may be the source of my confusion.
Jadeite said:
Never implied anything else. A Zen Archer can flank someone with a bow if he's next to him. A rogue with a wand can't (even if he has a short sword in his other hand).
Reading back, I can see that you were referring specifically to wands using a ranged touch attack, such as scorching ray, as per statements made by Transbot9. Out of context, it looks like you were referring to all wands. Sorry for the confusion.
I was referring to a melee touch attack with a wand, such as inflict light wounds, or shocking grasp. Melee touch attacks can be used when you flank an opponent, and so these wands would be valid for flanking sneak attack use, and would be significantly less expensive than a wand of scorching ray.
Primarily, I find a rogue using one of these wands in melee useful under two circumstances.
1. Opponent has high AC, where a touch attack can much more reliably hit, even in a situation where a rogue might be giving up an iterative attack to use it.
2. Opponent has DR (particularly high DR) where energy damage would more reliably be bypassing this than the rogue's melee weapon.
Obviously, there are situations when this tactic is particularly weak as well, such as against opponents with spell resistance.
I do believe that ranged touch attack do also have their place for the rogue, but they would certainly not get them in flanking situations. You'd more often get use out of this in situations like a surprise round, invisible rogue, or other cases where a ranged sneak attack would apply.
Again, you are correct in that a wand of scorching ray might be too expensive to invest cash in specifically for this tactic, but the rogue will continue to get mileage out of a wand of ray of frost or particularly acid orb (since it ignores SR) long after anyone else in the party, and those are pretty affordable.
For higher level wands that use melee or ranged touch spells, certainly the rogue may get better use out of them than a wizard or sorcerer if they find one in the field, but it may not be the best use of crafting time.