Well same thing started to happening with me yesterday after installing android L's developers' preview in my nexus 5. It worked well for first 4-5 hours but then after terminating a phone call when I put it back to my pocket problem started. I searched many forums for solution then I decided to re-install from image. I connected my phone to My PC (Which had driver installed & fastBoot setup) dramatically my phone started working well. And I detached my phone from PC. So I thought it might solved because after supplying charging. But after 3-4 hours it started again so I directly plugged in to electric socket but it kept on rebooting. Then I turned on my PC and attached my nexus 5 with it. Again it started dramatically.
Still I don't know the exact reason behind it. But good new is my phone is still working since last 16 hours... But I took care of not to launch some apps listed risky for developer's preview. So I thing some incompatible app launch may be a reason... but still its only "may be"
---------- Post added at 05:46 AM ---------- Previous post was at 05:42 AM ----------
If it happens again try what I just
answered and let us know if it worked for you? So we can come to know if solution was nexus 5 specific or android L specific. Also mention the OS version, please.