Raonic, who won the title at the SAP Open in San Jose last week, had finished as runner-up to Andy Roddick in 2011 and to Jurgen Melzer in 2012.
Sock won his first tour match of the year.
"It's always nice to get the highest-ranked win of my career," Sock said. "And it was nice to get that first win of my career. I hope to carry the momentum on this week."
Sock broke Raonic to go ahead 6-5 in the final set and closed the match with an ace, his 11th of the match.
Other seeds advancing Wednesday were No. 6 Tommy Haas of Germany and No. 7 Alexandr Dolgopolov of Ukraine.
Haas, runner-up to Raonic last week, posted a 7-6 (6), 6-4 victory Wednesday over Russia's Evgeny Donskoy.
Haas, 34, the oldest player in the draw, is a three-time Memphis champion who won the first ATP Tour title of his career in Memphis 14 years ago.
In other first-round play, former world No. 1 Lleyton Hewitt of Australia survived two match points in the second set and defeated Yen-Hsun Lu of Taiwan 2-6, 7-6 (3), 6-4.
Hewitt, who turns 32 Sunday, is seeking his first Tour title since 2010.
"I just hung in there," Hewitt said. "He played extremely well the first set and hit the ball extremely clean. I just tried to hang in there and hold my serve. I kept fighting."
The win by Hewitt was the 571st of his career, tying him for 25th place in tour history with Mats Wilander. Wilander won seven Grand Slam titles in the 1980s.
In women's second-round matches, top seed Kirsten Flipkens of Belgium advanced with a 7-5, 3-6, 6-3 victory over Lesia Tsurenko of Ukraine and No. 3 Sabine Lisicki of Germany beat Melinda Czink of Hungary 7-6 (0), 4-6, 6-2.
No. 2 seed and defending champion Sofia Arvidsson of Sweden was eliminated by Marina Erakovic of New Zealand 6-1, 3-6, 6-3. Arvidsson defeated Erakovic in last year's final.
"I came out a bit flat and didn't move well," Arvidsson said. "I tried to work my way into the match, but Marina played a great match. She was on fire, she was really aggressive."
Fourth seed Heather Watson of Britain and eighth seed Kristina Mladenovic moved into the quarterfinals. Watson beat Andrea Hlavackova of the Czech Republic 2-6, 6-0, 6-3 and Mladenovic defeated Victoria Duval 6-1, 3-6, 6-3.