Comma, quote needed before "quoted" material?

Option A is the best way to go here.

The quoted sentence is Hey, what's the matter with you?. To insert this into another sentence, you can:

  1. Put quote marks around it to make it a direct quote. In this case the quote is a question, so its punctuation needs to be included within the quote marks.
  2. Leave quote marks off and reword the direct quote to fit the containing sentence, thus creating an indirect quote.

    Did you ever ask Barb what the matter with her is?

The latter gets rid of the punctuation confusion because you aren't dealing with the direct quote's question mark anymore, but this isn't one of your choices, so the former is best.

As I stated at the beginning, the quoted sentence is set in stone already. Because of this, you can't drop the quote marks like in option B and C. This would imply an indirect quote, but the material doesn't fit the sentence anymore. Option D essentially changes the quote from a question to a statement, so it isn't ideal.