There's a trick, man. Nobody just sits down and writes all that.
1: Write an outline of all the points you want to talk about.
2: Write what you know already about each point. Figure out where you got that information and put a bibliography note after the paragraph. Mark all this stuff in red.
3: Quote your textbook. Teacher might have said not to do that, but if not it's a source that should count. If it doesn't, ask the teacher why he's using the textbook.
4: Get out there and find a couple sources that don't sound crazy. Watch out if they disagree with each other, but generally if you go after sources that talk about different things they probably won't have a chance to conflict.
5: Write your info that you found, make sure your info you knew ahead of time isn't wrong, and if it's cool then un-color it.
6: You're gonna do an introduction and a conclusion of some type. This is where you basically just summarize your paper. This way you give the reader three chances to understand, and if that's not enough then something is wrong with one or both of you. On a 10-page paper, it would be reasonable to have half a page for each of the intro and conclusion, meaning you actually only have a 9-page paper.
7: Does the bibliography count toward your page count requirement? If so, you can shave off another whole page.
8: Most teachers want you to double-space the lines so they can write their stuff in there in red ink. So you're actually only writing a 4.5 page paper.
9: You can get sneaky with formatting. Increase the margins just a tiny bit, increase the font kerning (space between letters), slightly increase the space between lines without going as far as 2.5 line spacing. This can get you an extra half page without being noticeable at all. In a pinch, certain fonts are well known for their horizontal space. Courier New is a particularly egregious offender, and may be banned. But Verdana is also rather wide and still looks good. Times New Roman is rather compact and should be used only if explicitly required.
So let's say you're at the end of what you can talk about on the topic and you've done some reasonable "creative formatting", and you're still only at 6 pages. You can expand your discussion on the topic and bring in more sources. You can frame this as "This stuff is about my argument #1, this next stuff is about my argument #2" and as long as it's all relevant to your topic (or thesis or whatever) and you tie it all together in your intro and especially conclusion, you're golden. Part of writing a long paper is picking a topic that's the right complexity for the page count you need to fill out.
However. I will say that unless you're super skilled at it, finessing the formatting can take longer than actually just doing more research and writing. You may also get some kudos from the teacher just for having a 10-page paper that's actually 10 pages without any chicanery behind the scenes. Everyone else will be skimping on this; if you don't, your teacher will start out with the assumption that you took the job seriously and didn't just start it the night before.