To answer your full question, you can do this with line item fields:
But as I originally read your comment, you can change the base price of a product using code that looks similar to this:
<?php
// Need these a couple of times...
$entity_id = 3;
$new_price = 4000; // $40 in minor units
// Load entity
$entity = entity_load('commerce_product',array($entity_id));
// Create Wrapper
$product = entity_metadata_wrapper('commerce_product', $entity[$entity_id]);
// Before change, using the devel module's dpm() function
dpm($product->commerce_price->value());
// Change price
$product->commerce_price->amount = 4000;
// Save this change
$product->save();
// Test saved data
$entity2 = entity_load('commerce_product',array($entity_id));
$product2 = entity_metadata_wrapper('commerce_product', $entity[$entity_id]);
dpm($product2->commerce_price->value());
?>