An exchange rate is the price of one currency expressed in terms of another currency. It is the price of switching (or swapping) between currencies.
The currency being priced is called the base currency. It is the first currency of the pair. The currency which is expressing the price is called the quoted currency.
The price expressed by the quoted currency amount is for one unit of base currency. So an exchange rate is quoted on a certain for uncertain basis; that is, one unit of base currency is priced in terms of an amount of units of the quoted currency.
Lets look at a USD/JPY currency pair - where USD is the base currency and JPY is the quoted currency.
The exchange rate for the USD/JPY currency pair tells us the value of the USD in terms of JPY; it expresses the amount of quoted currency needed to switch into or out of the base currency.
When a dealer quotes in the market to buy USD/JPY, he is buying dollars with yen. He is exchanging his yen for dollars
When a dealer quotes to sell USD/JPY, he is selling dollars for yen. He is exchanging his dollars for yen
Assuming a hypothetical exchange rate of USD/JPY = 112.85, 1 dollar is being priced at 112.85 yen.
If a transactor buys at 112.85, he is receiving one US dollar for 112.85 yen. He is selling yen at an exchange rate of 112.85 per dollar received.
If a transactor sells at 112.85, he is selling each US dollar to receive 112.85 yen. He is buying yen at an exchange rate of 112.85 yen per dollar sold.
The market follows an established hierarchy when it comes to selecting the base currency for any major currency pair. For example, for a trade between the US and Australian dollar, the market will quote AUD/USD. For exchange between the Australian dollar and British pounds, the market will quote GBP/AUD. The euro is always taken as base currency in any pairing.
The main thing to remember, however, is that, whenever you look at a foreign exchange quote, the currency being priced is the first currency in the pair, and the currency expressing the price is the second currency in the pair.