The sentry has 2 default spells: guardian shield and force field, as well as one that can be later researched: hallucination. On top of all of that, the sentry also has a beam attack that can hit ground or air. It doesn't do a whole lot of damage, but enough to make an impact for sure. As you can tell already, the sentry having these skills and even being able to attack bake it an extremely valuable unit. They are a bit expensive for early game units at 50 minerals and 100 gas, but this is because they are not meant to be massed in large quantities, but rather used as supporting units much like the infestor for zerg. It is however, much easier to get them out before an infestor.
First I'll explain the abilities it contains and how they affect gameplay, then I'll go into specific uses for them. The three abilities are:
Guardian shield costs 75 energy and provides a shield of 4 range all around the sentry. It reduces incoming ranged attacks by 2 damage to friendly units. Note: this does NOT help against melee attacks, hence it will NOT help against zerglings. It creates basically a small shield around the sentry that affects all nearby friendly units that happen to fall within it.
Force Field also comes stock loaded with the sentry and costs 50 energy, lasting for 15 seconds. It is also a smartcast move meaning that only one sentry will fire if you have multiple sentries selected, so you must repeatedly tell them to create forcefields if you want more than one.
Hallucination (must be researched first):
Hallucination must first be researched at the cybernetics core before use for 100 minerals and 100 gas. It costs 100 energy to use with hallucinations that last 60 seconds or until dead. It allows the sentry to create 4 probes, 2 high templars/stalkers/zealots, or 1 archon/colossus/immortal/phoenix/void ray/warp prism.
All of these abilities are useful in one way or another and can easily be utilized strategically. It is first important to survey the field in which you wish to use your sentries and manage their energy wisely. Perhaps the most commonly used as well as effective tool is the Force Field.
This move allows you to create force fields that block off enemy movement. It is used most effectively at choke points or to give your units stronger positioning. For example, if you are attacking an enemy base and his reinforcements are outside of the base, it would be very simple to create one or 2 force fields that block off his ramp so his units cannot proceed up and you can continue to wreak havoc in his base or pick off his army from a distance. Another example would be to place forcefields around your stalkers against an incoming zergling attack to prevent a surround. These are only a couple of example, but I'm sure you could use your imaginationa nd think of similar situations in which this would help.
The hallucination is much harder to use as it requires a lot of energy and key timing, and it must also first be researched. Hallucination is a good idea for creating heavy units to confuse your opponent such as colossi or archons so they focus down on them first, giving your real army time to whittle away at enemy forces. Another good usage is to create an early phoenix or warp prism hallucination to scout and harass the enemy base before air units are even seemingly possible. This could possible disorient, confuse, and event rick your opponent into thinking you're doing a different strategy than you really are.
Lastly is the guardian shield. It is an important asset to the protoss army, but is much easier to handle and requires far less micro than force fields. It should be used when the enemy army has a large amount of ranged attackers and definitely not when there is a large melee force attacking you. It only reduces ranged damage.
As you can see, the sentry has tons of options available and can aid any protoss army in innumerable ways, especially with some good micro and patience.