This page of our Minecraft guide focuses on ranged combat.
Besides the basic sword, the other standard weapon in Minecraft is the bow. Arrows are cheap to craft and they can be collected from the skeleton-bowmen that you kill. The game takes the flight physics into account so, with increase of distance comes decreased speed and the arrow falls to the ground. That is why, why aiming at a long distance, you also should take that into consideration. Bows can also be enchanted, to make them deal more damage. The strength that you use to pull the string influences the distance that the arrow will reach, and also the energy of the impact so, also the amount of damage dealt.
You can reflect the fireballs that Ghast shoots at you. This way, you can kill, not only him, but also several mobs within sight. It is not too much recommended method of fighting, because the risk of losing health is high.
You can load the Dispenser with Fireballs or Arrows, which will be discharged when the enemy e.g. breaks the cord attached to the Tripwire Hooks or stands on the pressure plate. It is not too much of an open fight, but rather a form of defense. It pays off to have a similar system installed near your house.