If banks create money by lending it out, how are they taking any risk? When I lend money to someone and they don't pay it back, I lose my money.  I can only lend out money that I own (or borrow).  I understand that when a bank lends money, that money is created the moment they lend it out.  If that is so, how does the bank take any risk in lending it out, considering they didn't own it in the first place?
Try the magic of double entry bookkeeping to see that creating money does not immediately make a bank more valuable. Initially the loan is matched by a deposit, and this is creation of what is effectively money:


Bank A has an asset: a newly created loan to customer B
Bank A has a liability:  B's newly created deposit with Bank A, which B can spend


B then spends the amount with C, who banks with D, and the deposit is transferred on B's instruction to C's account. Now


Bank A has an asset: a loan to B
Bank A has a liability:  Bank A owes money to Bank D
Bank D has an asset: Bank A owes money to Bank D
Bank D has a liability:  C's deposit with Bank D


Bank A now needs to settle with Bank D: this can happen through clearing if other customers are moving money to Bank A, but it is easier to imagine that Bank A tells the central bank to give some of A's reserve deposits there to Bank D. So Bank A has an asset, namely a loan to B, but this has been offset by an increase in liabilities or a reduction in other assets.  Similarly Bank D has an increase in assets, offset by a liability to C. The created money is now C's deposit with D, which C can spend.

Suppose the loan to B then goes bad and is never likely to be repaid.  From Bank A's point of view, the value of that asset falls to zero, while the associated increase in liabilities or reduction in other assets remains, and Bank A has to take this as a loss (negative profit), with the side effect of destroying that amount of money.  Bank A is now worth less (net) than when it started the loan to B.  This is the risk for Bank A from creating new financial assets and liabilities (i.e. new money).

If instead nothing goes wrong, B makes some money selling to E, pays A some interest, and possibly repays the loan (in which case the total amount of money in the economy reduces again).  In this case Bank A is more valuable (net), not directly from the creation of the loan or from its repayment or from use or return of the corresponding deposit, but from receiving the interest on the loan.  

When Bank A makes too many loans, it may run out of reserve deposits at the central bank after its customers spend the new money.  The solution to this is to take deposits from other customers, as Bank D does in the example above.  But these deposits may need interest to attract them, at a cost to the bank.  

So Bank A's overall profit on loans and deposits is the difference between the interest it receives from the loans it makes and the interest it pays on deposits it takes, allowing for the cost of bad loans; it may also make money from fees and have to pay for staff and other expenses.  The creation and destruction of money by making the initial loan and it being repaid is not Bank A's particular concern, though it is for the macroeconomic policy of the central bank and the government; if the economy grows and more loans are made, then the money supply also rises and the hope it that will happen neither too quickly nor too slowly.  Ultimately Bank A cares about the risk from bad loans, the interest rate margin and its administrative costs.