これがぺんです。
That is a pen.
あれがペンです。
It's a pen.
これはペンです。
それはぺんです。
This and that are determiners, so in Japanese we use が instead of は as a determiner.
When you asked "what is this?(これはなんですか)", you could say all of three, but the third(これはペンです)is the best.
I think it's the same as in English.