The cystic duct from the gallbladder joins the common hepatic duct from the liver to form the common bile duct. The common bile duct then empties into the duodenum if the spinchter of Oddi is open. The common bile duct then joins with the pancreatic duct to form the ampulla of Vater. The pancreas secretes pancreatic digestive juices and the gallbladder secretes bile which is synthesized in the liver and released during ingestion of fatty foods.