A method of preparing a nanomaterial comprising boron includes sonicating a boron trihalide and/or boron alkoxide in a hydrocarbon solvent with an alkali metal under an inert atmosphere to form a dark solid, and annealing the dark solid at a temperature sufficient to sublime alkali metal salt therein, thereby obtaining a boron nanomaterial. Reacting with a Group IVB metal produces a metal boride, and combining an alkali metal salt of a hydrocarbon with the boron trihalide prior to sonicating produces a carbonaceous boron material.