1. Stop bitcoind and namecoind
2. Backup the namecoin wallet.dat somewhere
3. Copy the bitcoin wallet.dat into the ~/.namecoin directory, overwiting the existing wallet.dat (make sure you did step 2)
4. start namecoind with: namecoind -rescan
5. Assuming you have the full namecoin blockchain you'll see the coins in the balance. You can then 'sendtoaddress' to a real namecoin address
6. stop namecoind
7. copy your namecoin wallet.dat backup back into ~/.namecoin
8. start namecoind with: namecoind -rescan
If you've sent bitcoin addresses to a namecoin address follow the same steps, swapping namecoin and bitcoin around. Note that it's the recipient of the original send, the owner of the address, that must do these steps. It's probably even better to do all this in a virtual machine with clean wallets so you don't accidentally overwrite your own wallet.