Q:

Which compound is responsible for the borax bead test?

When borax is heated, the reaction that takes place is :
$$\ce{Na_2B_4O_7.10H_2O \ce{->} 2NaBO_2 +  B_2O_3 + 10H_2O}$$
And the compounds that are responsible for the colors are $\ce{M_x(BO_2)_y}$ salts, like $\ce{Co(BO_2)_2}$. My question is, does this $\ce{BO_2}$ come from $\ce{NaBO_2}$ or from $\ce{B_2O_3}$ or do both of them react?

A:

A little chemical detective work gives a plausible answer.
Say the metal is cobalt and it's oxidation state is +2.  Then, with the cobalt calcined to the oxide, you have two possible acid-base reactions:
$\ce{CoO + 2 NaBO2 -> Co(BO2)2 + Na2O}$
$\ce{CoO + B2O3 -> Co(BO2)2}$
Both reactions look good, but upon further review the first one gives something we recognize as a powerful base, more likely to be a reactant than a product.  Moreover,  a quick check here reveals that boric oxide has a low enough melting point to liquefy in the flame, favoring the second reaction kinetically.
So the second reaction above is really the only plausible one.

