The Maricopa County Sheriff's Office says the incident occurred around noon Friday at Wigwam Creek Middle School in Litchfield Park.
Peter Busch, of CBS Phoenix affiliate KPHO-TV, reports it happened on the school basketball court, just before the lunch bell sounded.
Authorities say all but one of the boys has been released from the hospital.
An unidentified student is suspected of handing out the pills on the playground.
Other students told a teacher, who looked into the student's backpack and saw marijuana and prescription pills, authorities say.
School officials called 911 and were advised to send the six students to the hospital as a precautionary measure.
The Arizona Republic says the Sheriff's Office plans to soon serve a search warrant at the home of the suspected student.
School officials say there'll be consequences from the incident.
A parent of a student who wasn't involved in the incident told KPHO, "I'm kind of glad they made a big deal about it so that everybody is aware that prescription drugs are a problem."
Federal officials say prescription drug abuse among kids is up 40 percent in the past decade, citing easy access inside their homes as the main reason, Busch notes.