Nice question, Selim:)
I'd say it depends a lot!
You've got several answer already of different register.
"О чем, черт возьми, ты говоришь?" and "Что ты, черт возьми, говоришь!" are very nice, polite and, I'd say, posh.
"Что за ахинею ты несёшь?!" and "Что ты мелешь?" (Or just: "Что ты несёшь?") are also good options. Conversational, informal ones. But I personally never use any of them. They are a bit out-of-date. I might only say one of these if I was fooling around, as a part of a joke.
So, if I totally understood the message and just want to express that you don't agree with your friends's opinion, I'd say: "Что за бред?" and/or "Ты серьёзно?!"
If you really didn't understand what a person said, I don't think you should show off, just say it: "Что-то я не понял" or "В смысле?" (What do you mean?)
Hope it helps:)
Cheers,
Anna