Quantum embedding theories are powerful tools for approximately solving largescale, strongly correlated quantum many-body problems. The main idea of quantum embedding is to glue together a highly accurate quantum theory at the local scale and a less accurate quantum theory at the global scale. We introduce the first quantum embedding theory that is also variational, in that it is guaranteed to provide a one-sided bound for the exact ground-state energy. Our method, which we call the variational embedding method, provides a lower bound for this quantity. The method relaxes the representability conditions for quantum marginals to a set of linear and semidefinite constraints that operate at both local and global scales, resulting in a semidefinite program (SDP) to be solved numerically. The accuracy of the method can be systematically improved. The method is versatile and can be applied, in particular, to quantum many-body problems for both quantum spin systems and fermionic systems, such as those arising from electronic structure calculations. We describe how the proper notion of quantum marginal, sufficiently general to accommodate both of these settings, should be phrased in terms of certain algebras of operators. We also investigate the duality theory for our SDPs, which offers valuable perspective on our method as an embedding theory. As a byproduct of this investigation, we describe a formulation for efficiently implementing the variational embedding method via a partial dualization procedure and the solution of quantum analogues of the Kantorovich problem from optimal transport theory.