programmically change price of product
I suppose the existing answer is fine if every customer gets a unique version of the product to purchase. However, it should be obvious that if more than one person uses this it would fail.

You should instead look at what we recommend in this video tutorial:

http://www.drupalcommerce.org/videos/tutorials/donations-custom-line-item-types

The main idea is that you can enrich the line item with custom pricing information and then use the product sell price calculation system to swap in the appropriate custom price.