When a thunderstorm occurs, the first thing you should do is get inside a sturdy structure if possible to avoid potential lightning strikes. If a building is not available, a hard-top car would be the next choice, followed by any low sheltered area that is away from trees or other tall objects. Avoid areas that are prone to flooding, and make yourself the smallest target possible.
If you are trapped outside during a thunderstorm, you can decrease your chances of being hit by lightning. Lightning will strike the highest point because of less electrical resistance through air, so stay away from tall objects such as trees and telephone poles. Even if you aren't touching such an object, the electricity can jump from the object to you or travel through the ground. Stay away from bodies of water as well.
If you're traveling in a group, separate to avoid transmission of charge between everyone. You can crouch to the ground and put your feet together. This decreases your chances of standing on two patches of ground that have a potential voltage difference and allowing current to travel through you. The best thing you can do for safety is prepare beforehand. Pay attention to weather reports and avoid being outdoors when thunderstorms are in the area.