Introduced with the Transmetal 2 toyline in 1999, spark crystals are plastic bubbles in various colors, covering a vacuum-metal insignia of the allegiance of whatever Transformer possesses it (Maximal for Cheetor, Predacon for Dinobot II, etc.) They have been used on Transformers toys in several franchises since.
In the Beast Wars cartoon series, in at least Dinobot II and Cheetor, the placement of the spark crystal on the toy represents the actual placement of the Transformer's Spark in the body (Dinobot II's beast mode head/robot mode chest; Cheetor's left thigh). The Transmetal 2 Blackarachnia toy had two spark crystals (one Predacon, one Maximal), as her upgrade to Transmetal 2 was apparently the moment she began considering herself a Maximal (e.g., she began using "Maximize" as her transformation code).
In Beast Machines, the certainty of this is a bit fuzzier. The Maximals' sparks seem to be distributed throughout their bodies, only becoming the glowing orb when being extracted, so it could explain away some of the stranger places to put a spark crystal (like Geckobot's, which basically serves as his eyes and brain). And while this could also explain the presence of spark crystals on the Vehicon generals, the placement of spark crystals on Vehicons meant to be mindless drones doesn't make much sense (particularly the "Battle for the Spark" during the latter half of the television series).
In the Robots in Disguise line, spark crystals were only added to the Predacon sub-group. In the show, it fired a sort of laser blast.
With the rise of the Armada line, spark crystals disappeared, till the Energon line, where they became a tiny chromed insignia in the hole where you plugged in the Energon star. Presumably, it is supposed to be magnified by the translucent center of the Energon star. Many promotional photographs showed colored spark crystals on these figures, in red for Autobots and purple for Decepticons.
Redecos of toys featuring spark crystals often altered them, either by a tampograph of a faction symbol (many Universe toys), or by replacing the translucent plastic with opaque (such as Robots in Disguise Storm Jet).