A simple and effective approach is presented to construct coarse spaces for overlapping Schwarz preconditioners. The approach is based on energy minimizing extensions of coarse trace spaces, and can be viewed as a generalization of earlier work by Dryja, Smith, and Widlund. The use of these coarse spaces in overlapping Schwarz preconditioners leads to condition numbers bounded by C(1 + H/δ)(1 + log(H/h)) for certain problems when coefficient jumps are aligned with subdomain boundaries. For problems without coefficient jumps, it is possible to remove the log(H/h) factor in this bound by a suitable enrichment of the coarse space. Comparisons are made with the coarse spaces of two other substructuring preconditioners. Numerical examples are also presented for a variety of problems.