What happens when an airplane is retired?
There are a few things that can happen:


They are sold to another airline - In some cases the plane may still have life (cycles) left and may find it's later days flying for another outfit. Sometimes airlines for countries with emerging economies can only afford older aircraft and they may end up far from their original homes.  
They are sold to cargo airlines - cargo airlines may buy old passenger planes as they may not always be looking to fly the fanciest new airliners since the customer rarely talks back ;)
They end up in the bone yard - aircraft with life left on some parts hold at least some value and may be relegated to a bone yard to be picked over for years to come. 
Ultimately, scrap metal always has value...