Inaccurate?

Rainbow Beam

(Spell Compendium, p. 165)

Evocation [Light]
Level: Sorcerer 2, Wizard 2,
Components: V, S, AF,
Casting Time: 1 standard action
Range: Close (25 ft. + 5 ft./2 levels)
Effect: Ray
Duration: Instantaneous
Saving Throw: None
Spell Resistance: Yes

You fire a ray of swirling, multihued light drawn from radiant energies. The light's hues wind together but remain independent.

You must succeed on a ranged touch attack with the ray to strike a target. If you hit, the subject is dazzled for 1 minute. The spell also deals 1d12 points of damage per three caster levels (maximum 5d12). A rainbow beam deals a random type of damage as determined by the following table. If two types of energy are indicated, rainbow beam deals half its damage from each type of energy indicated. Creatures apply energy resistance separately to each type of damage.

1d8 Color Damage Type
1 red fire
2 orange acid
3 yellow electricity
4 green poison
5 blue cold
6 indigo sonic
7 violet force
8 multihued roll twice (ignore further results of 8)

Focus: A small clear gem or crystal prism worth at least 10 gp.