Let's ignore the rules for one second, and step into the realm of roleplaying.
You're an archer who is very skilled in the bow but lousy with a sword, even a club. You join an adventuring team that includes a fighter who is your polar opposite; he packs devastation into the swing of his axe, but for the life of him isn't agile enough to tie his shoes.
When you're in battle, you note that when the fighter is fighting multiple enemies at once, he attacks only one at a time, but is still protecting himself from attacks around him.
You fight from a range, but every so often, an enemy engages you in melee combat. You know that if you attack a creature at range, you have to take your focus off the space around you, and can be hurt by melee attackers.
At one point, your enemies take notice of you, and you are attacked by two goblins. You ready your bow; you can still hit at point-blank range. One hand holds the bow, and the other strings the arrow. You are focused on your target right next to you, so there is no way he can get in an attack. However, the other enemy can, and does, even though you have trained to gracefully dodge while stringing your bow. However, its attack is not enough, and you still fire your arrow at the other goblin. It falls backwards, the arrow protruding from its chest.
Now, we translate this into rules. Opportunity attacks are provoked when the target is not focused on the enemies nearby. When you are moving, you are focused on your destination, and your enemies can take an opportunity attack. When you use a ranged or area attack, you are focuses on your targets far away, and enemies can get in an opportunity attack. However, if you use a ranged attack on an adjacent enemy, you are focused on it, so how would it be able to sneak in an attack without becoming an extremely easy shot? I know the rules don't cover this situation, but that's why you need to cover them yourself. My rule is that you can't take an opportunity attack on a creature using a ranged attack if you are the target.
For area attacks, you can take an oa if you are a target, but not if you are in the square of origin, because that is where the attacker is focusing. It makes sense and works, giving ranged attackers a break, plus monsters can use this tactic too.