Hi Diana -
These can be tricky, espcially in such a fluctuation marketplace. First, you should have a good real estate attorney. I can recommend a couple of attorney I use a lot, if you'd like.
But, the bottom line is that the buyer and seller agree to price now, enter into a sales contract by which some of the montly rent would go towards the purchase price at the end of the term. If the buyer does not want to purchase at the end of the term then all the "rent" monies are just that, rent, and are kept by the seller/landlord. In this fluctuating market you may want to have some terms be that the price is negotiated at the end of the term, but that's a risk for both the potential buyer & seller. The price could go up but it could also come down.