Have you ever planted lettuce, or spinach, or cilantro alongside tomatoes in excitement over the lovely salads and tasty Mexican dishes you plan to make when they are ready only to find the lettuce/spinach/cilantro bolts and begins setting seed in early June? While your lovely tomatoes are nothing more than tiny green marbles?
Bolting is what happens when a leafy plant shoots up a center stalk and blossoms in order to make seed. If this is a common occurrence in your garden you can try a few things to prevent it.
First, look for slow bolt or heat tolerant/heat resistant varieties of these plants. These varieties are less likely to begin bolting when temperatures jump up for a short time. Second, try planting these crops in a partially shaded corner of your garden, or even fully shaded. Diffuse light is enough for these plants and they can manage just fine getting the second hand light reflecting off neighboring sunny areas or through a cloud cover while being protected during the hottest part of the day. Another option is to plant them to the East of a shrub, tall plant, or tree, they will have full sun early in the day, but be shaded after noon to keep them cooler. Lastly, you can try covering them with a shade cloth during the hottest days; this is an option many garden books suggest, but I find it the least practical option since it requires much more attention on the gardener's part.
In the event your leafy plants do bolt, don't panic too much. Plant a few more, or grow some lettuce and cilantro on a window sill inside the air conditioned house. Or just make the most of what you've got and harvest the dry seed for next year. Cilantro seed is called coriander and is an excellent spice in it's own right, so you can plant it or add it to your spice rack.
Lettuces will cross-pollinate with impunity, as will spinach. This means that if you plant several different types of these plants and they flower at the same time you will likely get seed that is the offspring of the two parents rather than a clone of the original plant. You may end up with a fabulous new variety of lettuce or spinach all your own; of course the flip side of that is that you may end up with seed that grows less tasty plants that are not worth growing. It's a gamble, but these plants grow quickly and it's worth it to try planting your own seeds and see what you get. If you find a favorite new cross you can remove the others before they flower and just let that variety flower to make more seed of that type.