The past several years have witnessed important developments in the QCD theory of jet production and jet substructure in hadronic collisions. In the framework of soft-collinear effective theory, semi-inclusive jet functions and semi-inclusive fragmenting jet functions have allowed us to combine higher order calculations with resummation of potentially large logarithms of the jet radius, ln R. Very recently, the semi-inclusive jet functions for partons fragmenting into heavy flavor jets were computed by Dai, Kim and Leibovich. In this paper we show how the formalism can be extended to c-jet and b-jet production in heavy ion collisions. The semi-inclusive jet functions for heavy flavor jets in a QCD medium are evaluated up to the next-to-leading order in α s and first order in opacity. For phenomenological applications, we also consider the inclusion of the cold nuclear matter effects and the jet energy dissipation due to collisional interactions in matter. We present the numerical predictions for the cross sections and the corresponding nuclear modification factors in proton-nucleus and nucleus-nucleus collisions and compare our results to data from the Large Hadron Collider.where f a,b denotes the usual PDF for parton a or b, dσ ab→c (ŝ, p T ,η, µ)/dvdz represents the hard function for the sub-process ab → c, and J J/c is the jet function describing the probability of a parton c with transverse momentum p T /z c to fragment into a jet J with p T . The variablesŝ andη are the partonic center-of-mass energy and parton rapidity. The SiJFs depend on the momentum fraction z c taken by the jet, the jet energy w J , R = R/ cosh(η) from the jet reconstruction algorithm, and the quark mass m Q . The ln R resummation for jet production can be achieved by evolving the SiJFs from the jet scale µ J to the