This phase II trial is studying how well giving sorafenib together with docetaxel and cisplatin works in treating patients with metastatic or locally advanced gastric or gastroesophageal junction cancer that cannot be removed by surgery. Sorafenib may stop the growth of tumor cells by blocking some of the enzymes needed for cell growth and by blocking blood flow to the tumor. Drugs used in chemotherapy, such as docetaxel and cisplatin, work in different ways to stop the growth of tumor cells, either by killing the cells or by stopping them from dividing. Giving sorafenib together with docetaxel and cisplatin may kill more tumor cells.