Many modern applications rely on convex optimization, which offers a rich modeling paradigm as well as strong theoretical guarantees and computational advantages. Convex duality often plays a central role. I will describe the geometry behind a simple form of convex duality based on polarity of convex cones, its relationship to lifting, and show how it leads to a computationally efficient algorithm for the phase-retrieval problem in X-ray crystallography.