There are several potential ways to store hydrogen for use in a vehicle engine. Some of them are as follows...

  • Chemically Bonded. You could (and people have) store the hydrogen by binding it to iron in the form of...rust. Yes; rust. Since ferrous oxide is nice and stable (more stable than iron alone in an oxygen atmosphere), apparently baking off the hydrogen from ferrous hydroxide is not too difficult; then, voilà, hydrogen. The advantage here is that when bonded to the iron or other metallic retainer, the hydrogen is unable to burn/explode/expand etc. The disadvantage...well, carrying around enough rust pellets to make this work is really, really heavy...also, the other end of the fuel cycle (fueling up) isn't quite as well thought through.
  • Under Pressure. Hydrogen liquifies quite easily under pressure. It can be stored in strong metal or ceramic tanks (ceramic to avoid sparking on damage, and avoid cryogenic brittling of the metal) and released as a gas. This has the advantage of being easily refilled and transported. The disadvantage is the strength of the tank required means it'll be quite heavy or your payload will be small; also, liquid or gaseous hydrogen, as has been noded, explodes quite happily when ignited (which is easy). This would make accidents a tad dangerous. Gasoline, at least, just burns unless the right vapor mixture is present.
  • Bonded, as water. This is explored above. Essentially, the amount of energy it takes to separate hydrogen and oxygen is (surprise!) the same amount you get when you burn it. Therefore it's a zero-sum game unless you have a neat trick of disassociating the two, as mentioned in the fascinating steam technology above. It would be a good way of concentrating the energy taken in by efficient but low-power solar panels; electricity might be used to split water, thus providing combustion fuel for the 'power' part of a hybrid engine.

There are, of course, others; this is a hot area of research as oil prices skyrocket due to panic and limited production (I'm hesitant to say shortage; there's no hard evidence that the immediate price spike we're in is due to such).