Take a look at Magento Migrate customers with no password.
$customer = Mage::getModel('customer/customer');
$password = '123456';
$email = '[email protected]';
$customer->setWebsiteId(Mage::app()->getWebsite()->getId());
$customer->loadByEmail($email);
if($customer->getId()) { // if customer does not already exists, by email
$newPassword = $customer->generatePassword(); // generate a new password
$customer->changePassword($newPassword); // set it
$customer->save();
}
Assuming that you want to use the default magento password template then take a look at app/code/core/Mage/Adminhtml/controllers/CustomerController.php
// Send welcome email
if ($customer->getWebsiteId() && (isset($data['account']['sendemail']) || $sendPassToEmail)) {
$storeId = $customer->getSendemailStoreId();
if ($isNewCustomer) {
$customer->sendNewAccountEmail('registered', '', $storeId);
} elseif ((!$customer->getConfirmation())) {
// Confirm not confirmed customer
$customer->sendNewAccountEmail('confirmed', '', $storeId);
}
}