An exponent can be entered from the Math Panel (see below), but it's actually simpler just to type the caret key, ``^''. LYX will place another blue rectangle in the superscript, so that whatever you write next will be superscripted, and in a smaller font size. Everything you type until you hit a Space (or Esc to exit Mathed entirely) will be in the superscript.
Writing a subscript (index) is just as easy -- start one by typing the underscore key, ``_``. You can subscript and superscript both subscripts and superscripts like this: Aa0+b2 + Ca0+b2.
Exercise: Put equation 1 of example_raw.lyx into math mode.