When photographing sports, many things happen so quickly that by the time you've let the camera focus and pressed the shutter button, the action shot you wanted to capture is already over. It is important to try and anticipate the action so you can have your shot set up and ready.
Timing peak action
While you can't anticipate everything that happens in sports, there are many things you can anticipate. For example, a soccer player about to take a free kick, or a baseball player about to hit the ball. Half press the shutter button on your camera to lock autofocus and exposure on the player or where the player is likely to be when they come to hit / kick the ball.
By pre-focusing and setting the exposure at this point, you save the camera having to do this when it comes to take the shot. This means the camera will take the photo much faster when you push the shutter down fully than it would otherwise.
Keep the shutter half-pressed down, then press it down fully just before the player hits or kicks the ball.
If you find your resulting shot was too late i.e. the ball has already been hit / kicked out of the frame, then next time try and press the shutter a little earlier. Conversely, if the shot you got is too early i.e. before the ball or player has entered the frame, then next time try to press the shutter a little later. Easier said than done, but with some practice you'll be able to get your timing right most of the time and capture some great peak action shots.
An alternative to timing your shots just right is to use continuous shooting. This takes a stream of photos while you hold the shutter down. By pressing the shutter before the peak action event, and then releasing it after, you have a number of photos of the action, and can choose the best, or merge them into a single photo, as below.
Continuous shooting is not available on all cameras, and it will work better on a camera that has a higher continuous shooting rate. E.g. A camera that can shoot continuously at 3fps (frames per second) will not capture as many shots as a camera that can do 8fps (frames per second). The camera that can do 8fps has a higher chance to capture the critical peak action shot than the one that can only do 3fps.
Most cameras have an option to change to continuous shooting mode, and some also let you choose how many frames per second you want to shoot. E.g. a camera capable of 8fps may let you choose between 8, 5, and 3 frames per second continuous shooting.
Another thing to be aware of when using continuous shooting is your camera's buffer. The buffer is memory where the camera stores the photos before it writes them to the memory card. Most cameras can shoot photos faster than they can write them to the memory card. If you take a lot of photos continuously, you may find that the camera's buffer gets filled up and you have to wait for it to write the photos out to the memory card before you can take any more.
If you normally shoot RAW files, for continuous shooting it is better to stick with JPEG files. This is because JPEG files are compressed, and so smaller in filesize. So you can take more JPEG photos continuously before the camera's buffer will get filled up.
A fast memory card is also important so the photos can be written to the card and removed from the camera's buffer faster.
Subjects and composition
Sport is an emotional game, and if you can get close enough, you can capture some fantastic expressions. The joy on a player's face after scoring or the anguish at missing a shot work well, but also look for the expressions of concentration and determination that you'll see throughout the game.
Messi se lamenta by americanistadechiapas on flickr (licensed CC-BY)
When capturing a player running or hitting a ball, compose the shot so that they have some space in front of them to run into or hit the ball into.
To get good shots of the players, unless you can sit / stand at the sidelines, you'll probably need a long zoom / telephoto lens.
If you are photographing with a DSLR, these lenses can be quite big and heavy. It might be worth checking with the game organizers before you bring your large telephoto lens though, as you may find that 'professional' photography equipment is not allowed.
If it is allowed, a monopod might be a worthwhile investment if you don't already have one. This supports your camera and lens, taking much of the weight off your arms. You'll be particularly thankful for it when shooting a long match with a heavy camera / lens combo.
Freezing and blurring the action
To freeze the action you need a fast shutter speed. You can use the shutter priority shooting mode on your camera to set a specific shutter speed that you want to shoot at e.g. 1/400s.
Or you can use aperture priority mode and set the aperture quite wide e.g. f/4 or f/2.8. So long as there is plenty of light, the camera will then be forced to use a fast shutter speed for the correct exposure.
Finally, you could try manual exposure to allow you to control both the shutter speed and aperture. If the whole area is evenly lit then exposures shouldn't vary too much and manual may be a good idea.
Depending on the light levels, you may need to use a high ISO setting to allow properly exposed photos with a fast shutter speed. This is particularly true when shooting indoor events such as basketball.
Don't use a fast shutter speed for all your shots though. When a player is moving parallel to your position, try using a slower shutter speed and panning with them to keep them roughly in the same place in the frame the whole time. This results in a nice photo with a blurred background while the subject is still well defined.
With these tips you should be able to take better sports photos, as always, practice makes perfect (or at least makes you better!)