In Debt?  Invest Anyway! (Maybe)                                     Positive Returns                 

Whether or not one should invest while still in debt is a common, but fairly easy question to answer.  There are 2 reasons why one should invest despite other financial obligations.  There is the financial factor and the psychological factor.  Let's explore both factors with a couple of examples.

Bobby is $30,000 in debt from school loans.  Since he was able to consolidate his loans during a period of favorable interest rates, his APR is a low 2.5%.  After recently obtaining a $1000 bonus at work he contemplates whether to invest it or pay down his student loans.  Not yet feeling comfortable with stocks and bonds
he looks into the Money Market Fund at his bank.  Interest rates have gone up since he consolidated so his bank is paying 5% annually on money in the Money Market Fund.  After doing some "back of the napkin" calculations, Bobby puts his bonus in the bank.  Did he make the right decision?

Financially - Yes!  
Here are the numbers - If he puts the $1000 toward his loan, his balance would drop to $29000.  
2.5% interest on $30000 is $750
2.5% interest on $29000 is $725

So Bobby saves himself $25 by putting the $1000 toward his loan.  But what about the numbers for the money market?

The money market yields 5% annually.
$1000 with 5% interest is $50.  So Bobby makes $50 in interest by putting his money in the bank, double what he saved by putting it towards his loans.  So when Bobby does pay his student loans (and he will have to eventually) he will net $25.  

So did Bobby make the right decision psychologically? - Most likely
Given that his student loan debt is so large Bobby will probably be paying it back for 10-20 years.  The difference between owing $30000 and $29000 is not that big of a difference while knowing that he has money in the bank working for him could be a great mental boost.

Our next example:

Sam has not made wise financial choices and is now has $2000 in credit card debt.  Given his negative history his APR is 30%.  He works at the same place as Bobby, received the same $1000 bonus, and is looking into the same Money Market Fund that has a 5% annual yield.  What should he do with his money?  

Financially - Pay down his credit card balance.  Here's why.
If he chooses not to pay his credit card he will end up paying
$600 in interest during the year.  That obviously dwarfs the $50 he would make in interest by putting the bonus in the bank.

What is the psychologically correct answer?
That is more difficult.  While it might ease Sam's conscience to cut his debt in half, he might also enjoy knowing that he has some assets in the bank saved up in case an emergency happens.  It's up to him.

So if you are trying to decide whether to pay down debt or invest, the key thing is to compare the interest rate of your debt with the interest you would be earning if you invested.  Financially speaking, it is an easy choice.  What is better psychologically is entirely up to you.  Sorry.