Lettuce—a cool season crop—naturally bolts in warm weather.
When temperatures rise much above 70°F/21°C, lettuce—an annual—will send up stalks, flower, and set seed, nature’s way of ensuring a next generation. This process is called bolting.
When lettuce and other leafy crops bolt natural sugars depart the leaves for the flowers and seed. When lettuce bolts the leaves are left with a bitter taste, and, for the lover of sweet and tender lettuce, the growing season is all but over.
There are just few protections against bolting; none are a sure thing. Place shade cloth over your leafy green crop to moderate warming temperatures; irrigate to bring the surrounding soil temperature down; plant in the shade of taller plants; and plant bolt resistant types and varieties.
Lettuce types in order natural resistance to bolting are: loose leaf, Romaine, butterhead, bibb, and crisphead. When buying lettuce seeds, check packets to make sure the variety you choose is bolt resistant. (Click here for a list of types and varieties of lettuce that resist bolting: Bolt and Heat Resistant Lettuce.)
One more suggestion: lettuce and other leafy greens started in temperatures consistently below 50°F/10°C have a tendency to bolt later in the season. Keep this in mind for next season.
More tips at How to Grow Lettuce.