Basis risk is the risk associated with imperfect hedging arising from using exchange-traded standard contracts to hedge instruments based on a different commodity.
Imperfect hedging can arise because:
There is often a mismatch between the expiration date of the futures contract used as the hedge and the actual selling date of the hedged asset. Under such conditions, the swap price of the asset and the futures price of the hedging tool do not converge on the futures expiration date.
When using exchange-traded products they often do not exactly correspond to what the trader is attempting to hedge or to speculate in.
For example, in the case of a derivative whose underlying is an OTC commodity, there is no obvious hedging tool. That is, because the underlying is not exchange-traded, there are no futures contracts on the same underlying with which to hedge the derivative. Accordingly you must hedge it based on a futures contract for a different underlying, which may lead to basis risk. So if, for example, you hedge an OTC natural gas commodity with a Henry Hub exchange traded future (according to market convention), the underlying prices are not the same. Accordingly there is a risk that the price difference between the exchange-traded futures contract and the OTC swap being hedged by it will change.
There are a number of contracts available in the OTC market to hedge basis risk, but the simplest is a Basis Swap or an OTC Spread Swap. Using a basis swap basically closes the gap between the exchange-traded futures contract's price and the price of the other asset to give you price certainty.