  We establish new necessary and sufficient conditions for the discreteness of
spectrum and strict positivity of magnetic Schr\"odinger operators with a
positive scalar potential. They extend earlier results by Maz'ya and Shubin
(2005), which were obtained in case when there is no magnetic field. We also
derive two-sided estimates for the bottoms of spectrum and essential spectrum,
extending results by Maz'ya and Otelbaev (1977). The main idea is to optimize
the gauge of the magnetic field, thus reducing the quadratic form to one
without magnetic field (but with an appropriately adjusted scalar potential).
