An accurate characterization of cell-cell communication (CCC) in the local tissue microenvironment is critical for elucidating the diverse biological processes that coordinate normal physiological development and disease progression. Emerging spatially resolved transcriptomics (SRT) techniques provide rich information on gene expression and cell locations that enable detection of CCC in their spatial context at unprecedented resolution. Here, we introduce a Bayesian framework, spacia, to detect CCC from SRT data, by fully exploiting their unique spatial modality, which dramatically increased the accuracy of the detection of CCC. We highlight spacia's power to overcome fundamental limitations of popular single-cell RNA sequencing-based tools for inference of CCC, which lose single-cell resolution of CCCs and suffer from high false positive rates. Spacia unveiled how various types of cells in the tumor microenvironment differentially contribute to Epithelial-Mesenchymal Transition and lineage plasticity in tumor cells in a prostate cancer MERSCOPE dataset. We deployed spacia in a set of pan-cancer MERSCOPE datasets and derived a signature for measuring the impact of PDL1 on receiving cells from PDL1-positive sending cells. We showed that this signature is associated with patient survival and response to immune checkpoint inhibitor treatments in 3,354 patients. Overall, spacia represents a notable step in advancing quantitative theories of cellular communications.