In 2012 Carson published America the Beautiful: Rediscovering What Made This Nation Great (cowritten with his wife), a work reflecting his growing interest in politics. The following year he appeared at the National Prayer Breakfast, a traditionally nonpartisan event organized by the Family, a Christian movement. In his keynote speech, Carson was highly critical of U.S. Pres. Barack Obama, who was in attendance, and the resulting media attention helped make Carson a rising star in conservative circles. In mid-2013 he retired as a surgeon, and the following year he joined the Fox News Channel as a commentator. In that role, he expressed his opposition to same-sex marriage and abortion and claimed that homosexuality is a choice. He also was highly critical of the Patient Protection and Affordable Care Act. In 2014 he wrote (with his wife) One Nation: What We Can All Do to Save America's Future, and the following year he entered the 2016 U.S. presidential election race. In the 2015 volume A More Perfect Union: What We the People Can Do to Reclaim Our Constitutional Liberties (also written with his wife), he issued his interpretations of the mandate established by the U.S. Constitution.
With his conservative agenda, Carson initially proved popular with Republican voters, and by October 2015 he was among the party's front-runners. However, soon thereafter his campaign began to struggle when questions mounted concerning his grasp of foreign policy. In addition, his debate performances were criticized for a perceived lack of energy. After failing to win any states a month into the primary election season, Carson formally suspended his campaign in early March 2016. He was a vocal supporter of eventual winner Donald Trump, who in December 2016 announced that he would nominate Carson to serve as secretary of the Department of Housing and Urban Development. In March 2017 Carson was confirmed by the Senate, 58–41, and took office shortly thereafter.
In an effort to promote self-sufficiency, Carson supported rent increases for those receiving federal housing assistance or living in public housing properties. He also sought to reduce housing regulations, including those designed to end discrimination. Such moves were met with opposition, as critics alleged that he failed to understand the complexities of the issues. In a February 2019 interview Carson suggested that he would leave HUD at the end of Trump's term in 2021. In March 2020 he was appointed to the government's task force handling the coronavirus pandemic. In November it was announced that he had tested positive for the disease, and he later claimed that he had become "desperately ill" but recovered after Trump intervened to get him access to an antibody treatment that required FDA approval. Carson stepped down as secretary of HUD in January 2021.