That behavior could occur if your Mac and PC are connected to different routers.
Do you have multiple routers on your network? If not, what is the Brand/Model of your router and your modem? Some modems have an integrated router, which could cause this problem if you are using a separate router as well.