Accumulation of excessive ammonia is a big threat to aquatic animals, which causes adverse effects on the health, production reduction, and even high mortality. The razor clam Sinonovacula constricta, a bivalve living in intertidal mudflat with a deep-burrowing lifestyle, often faces a high concentration of ambient ammonia. However, there is less available information concerning the toxic effects of ammonia on razor clam and its molecular mechanisms of adaptation to ammonia stress. The aim of this study was to investigate the effects of ammonia exposure on the gill and hepatopancreas of razor clam by transcriptome sequencing. The results showed that the median lethal concentration of ammonia was 244.55 mg/L for 96 h. A total of 1,415 and 306 differentially expressed genes (DEGs) were identified in the gill and hepatopancreas, respectively. The functional annotation showed that DEGs of the gill were mainly involved in the regulation of nitrogen compound metabolic process, nitrogen compound transport, and amide transport. The DEGs of the hepatopancreas were mostly enriched in oxidation-reduction process, response to stress, and amine metabolic process. The expression levels of NH3/NH4+ transporting channels and H+ excreting-related genes, including Rhesus glycoproteins (Rh), Na+/K+-ATPase (NKA), Na+/H+ exchanger, V-ATPase (VHA), and carbonic anhydrase (CA), were upregulated significantly in the gill (p < 0.05). In addition, the expression levels of glutamine and urea synthesis-related genes that played vital roles in ammonia detoxification, such as glutamine synthetase (GS), arginase (ARG), and argininosuccinate synthetase (ASS), were also increased obviously in the hepatopancreas (p < 0.05). Taken together, our results indicate that the synergistic action of ammonia excretion in the gill and ammonia metabolism in the hepatopancreas might be the mechanism through which the clams tolerate to environmental ammonia. This study provides a molecular basis for the better evaluation of the responding mechanism of ammonia tolerance.