The fin of a shark that occasionally breaks the water's surface is called the dorsal fin. According to the ReefQuest Centre for Shark Research, it is actually rare for this to happen, as sharks typically swim mid-water or near the ocean's bottom. Sharks do not intentionally expose this fin.
A shark may investigate the surface and subsequently expose its dorsal fin if there is floating bait. A more common scenario, however, is if the shark wanders into waters that are too shallow for its body. Sharks are prone to sunburn like humans, which is another reason they usually avoid the surface.