Exactly, a foe is a foe, an ally is an ally.It doesnt hit your own partner, i say this as a doubles player - adjacent foes means both the enemies.
What i assumed happened is that the game thought slowbro was rampardos (?) which is why dazzling gleam did a lot of damage (although it shouldnt have hit at all) and thunderbolt did nearly nothing
http://replay.pokemonshowdown.com/randomdoublesbattle-153488696
Same thing happened, deoxys goes out, he loses 70% hp for some non-explained reason.
"The opposing Deoxys-Defense lost some of its HP!"
Then it's attacked and it goes from 30% hp to 70% hp... kinda funny.
My guess is in both cases that the hp wasn't lost at all, so in deoxys case it was just calculated from 100% hp and in slowbro's case it was calculated from 100% aswell - so thunderbolt actually made him lose a bigger chunck than I thought.
The bug appears to be only graphic but it's actually kinda important, in the slowbro game I didn't thunderbolt him again because I had seen a 7% damage thunderbolt...