I think the answers below have already addressed the main question. I just wanted to add that most lenders will permit up to 60 days of rent back in a purchase situation. Trulia answers get found in searches all the time, so I just want this vital piece of info to be associated with this thread as well.
Best of luck,
Yes, there is a rent back after purchase agreement form available to your friends agent through CAR (CA Assoc. of Realtors). The form covers pretty much everything including when the sellers are to vacate the property, what amount they pay, how they are expected to keep up the property, etc... If there is anything unusual that is required, there is room to write it into the agreement on the form.
Having a clear understanding and a written agreement protects both sides and avoids awkward circumstances.