わけ (in kanji 訳) means
① "I heard... But are you sure that... (Is it true that...)? I doubt it"
or
② "How on earth...? I doubt it's possible."
Both of them are used for just emphasizing and the situation when the speaker is little bit angry.
Ex sentences
①type
この辺に来ればお金がもらえると聞いたけど、本当なわけ?
I heard I can get some money when I come to here around. But is it true? (I doubt it)
②type
私たちの家からこんな遠くまで来て、どうやって帰るわけ?
We came to this place far away from our house. But how on earth can we go home? (I doubt it’s possible)
But 「〜わけね、〜わけなのね、〜わけなのか」means "I see" so be careful not to confuse with it.