AoE (area of effect) spells feature friendly fire (hit allies) within the zone indicated in red in the targeting UI. The yellow part, which grows with INT, only hits foes.
Not all spells with an AoE feature friendly fire, the per encounter wizard spell for example. The easiest way to see is if it highlights any of your party members when targeting them.