A device configured for converting energy includes a first surface, a second surface configured for moving with respect to the first surface during operation of the device, and a coating disposed on at least one of the first surface and the second surface. The coating includes a first layer of a ceramic alloy represented by the general formula AlMgB.sub.14--X, wherein X is present in an amount of from 0 to 70 parts by weight based on 100 parts by weight of the ceramic alloy and is a doping agent selected from the group of Group IV elements and borides and nitrides thereof, and a second layer disposed on the first layer and including carbon in a gradient concentration. The coating has a hardness of from 10 to 20 GPa and a coefficient of friction of less than or equal to 0.12.