A ranged weapon is any weapon that can engage targets at distances greater than hand-to-hand distance. It is sometimes also called projectile weapon because it typically works by launching projectiles (missiles), though a directed-energy weapon (which doesn't involve projectiles) technically is also a ranged weapon. In contrast, a weapon intended to be used in hand-to-hand combat is called a melee weapon.
Ranged weapons give the attacker an advantage in combat since the target is often getting hit from beyond immediate visual range and therefore has less time to react and more difficulty to effectively defend and hit back. It also puts distance between the attacker and the opponent, which is a safer combat option since the close physical contact during melee combat often puts the attacker within the immediate striking range of the enemy counterattack and thus has an equal risk of getting hurt and killed.
The line between ranged and melee weapons is not entirely definite; for instance, spears, axes, knives and daggers can be used for both throwing and stabbing, depending on purpose and situation; and a ranged weapon can also be used as a melee weapon in close encounters, such as a rifle can be used for melee with its and a fixed bayonet, and even an arrow can be used for stabbing in desperate situations. Early ranged weapons often include specifically designed hand-thrown weapons such as javelins, slings and darts, as well as more complex elastic weapons such as slingshots, bows and arrows and crossbows, and siege engines like stone throwers, catapults, ballistas and trebuchets. These ranged weapons were extremely effective in combat in comparison to close-combat weapons, as they gave the wielder opportunity to launch multiple projectiles before an enemy armed with melee weapons or shorter-ranged missile weapon posed a threat to him. Siege engines were also used for overpassing or destroying obstacles like fortifications.