Spiked bars consist of a metal rod of spikes held by two vertical posts. The placement of the spikes vary from above and below the spikes to to diagonally of four directions, but usually hard to the touch.
In gameplay, when a playable character physically touches the spiked rod of the game, they will receive damage. As such, they usually serve as obstacles that are placed along the player's way. The supports however re harmless to the touch. The spike rod can move up and down and will try to determine and obstruct the players path. However the spike rod moves at a certain pace and can be voided in various ways.
In Sonic Adventure and Sonic Adventure DX: Director's Cut, spiked bars debut in Emerald Coast. In these games, they have vertical spikes and move up and down to prevent Sonic from passing through them..
Sonic the Hedgehog (2006)
Variants of the spiked bars can be found in Blaze stages where they ar elarger and have additional spike rods. However given these spike rods are fixed and do not move mean they can be passed through if the spikes are avoided.