An aspect of the present invention is an electrical device, where the device includes a current collector and a porous active layer electrically connected to the current collector to form an electrode. The porous active layer includes MgB.sub.x particles, where x.gtoreq.1, mixed with a conductive additive and a binder additive to form empty interstitial spaces between the MgB.sub.x particles, the conductive additive, and the binder additive. The MgB.sub.x particles include a plurality of boron sheets of boron atoms covalently bound together, with a plurality of magnesium atoms reversibly intercalated between the boron sheets and ionically bound to the boron atoms.
 The United States Government has rights in this invention under Contract No. DE-AC36-08G028308 between the United States Department of Energy and the Alliance for Sustainable Energy, LLC, the Manager and Operator of the National Renewable Energy Laboratory.