If you are in a formal situation, or don't know the person well, or the other person is above you in age or status, say "Thank you". or "Thank you, sir". or "Thank you very much, I appreciate you".
If it is a casual situation, or your are comfortable with the other person, or he is your friend, you can say "thanks".
If you are being sarcastic, or really mean the opposite, you can jokingly say "Thanks a lot...for nothing". Or "Thanks a lot!"