How does finder show a pc computer name but I can't ping it?
If a machine is found via Bonjour/multicast DNS, you may need to add a .local suffix to use the hostname in Terminal.  If it was found via NetBIOS (either broadcast or WINS), you may need to use nmblookup to get an IP address:

rushlight:10120 Z$ nmblookup mress
querying mress on 10.0.204.255
10.0.204.14 mress&lt;00&gt;
10.0.204.14 mress&lt;00&gt;