I've been looking around and am trying to find a definitive quotable answer on this. The spell description says in it's first sentence anyone attacking you in melee combat that doesn't have a man made reach weapon is affected by the spell. However, in the following paragraph it simply states that in addition to taking normal damage if you're hit the attacker takes X damage if all the necessary prerequisites are met.
Does anyone that swings at you (hit or miss) take damage or only the folks that hit you?