Can I use my iMac as a display with my MacBook?
Which model of iMac do you have? Only the latest 27-inch model supports video in physically. There are software solutions if you don't have this model.

I'm not sure if this is the latest solution (I expect not), but it was a software solution to this problem. http://www.rutemoeller.com/mp/ibook/ibook_e.html

I'm sure I've seen something more recent than this, but can't find a link to it unfortunately.

Update: Found the software I was thinking of, the developers site is here: http://www.screenrecycler.com/ScreenRecycler.html