Q:

Plants before the Sun in the Order of Creation

Why does plant life precede the Sun in the order of creation given that plants need the Sun to do photosynthesis? 

A:

First, it may not be valid to assume that creation was bound by the laws of science as we now understand them.  Why should we assume that the very first plants grew by photosynthesis in the same way that plants do now?  Or if we do, why not assume that the primordial light created on the first day was enough to produce this effect?
But setting all that aside, Bereishit 2:5 presents us with a related question:

Now no tree of the field was yet on the earth, neither did any herb of the field yet grow, because the Lord God had not brought rain upon the earth, and there was no man to work the soil.

It's not clear when this text refers to; it falls after vay'chulu and and before the (second) creation of Adam.  This verse seems to say that plants depended on man being available to work the soil.  But chapter 1 says we got plants on day 3, so how do we resolve this?  Rashi offers the following interpretation:

neither did any herb of the field yet grow: [I.e.,] had not yet grown. And on the third [day], where it is written: “Let the earth bring forth,” they [the plants] had not yet emerged, but they stood at the entrance of the ground until the sixth day. And why?
Because… not caused it to rain: Because there was no man to work the soil, and no one recognized the benefit of rain, but when man came and understood that they were essential to the world, he prayed for them, and they fell, and the trees and the herbs sprouted. — [from Chul. 60b]

According to Rashi, when God created the plants, trees, and grasses on day three, they didn't actually start growing -- they were, essentially, "queued up" underground, waiting for rain, which in turn waited for a man to recognize the need for rain and pray for it.
With Rashi's interpretation, the sun, moon, and stars were well-established before the need for photosynthesis arose.

A:

Ralbag has two explanations of the order of creation that can address this. The first explanation is that everything existed at once. The sequence delineated in Genesis is just the order in which they were revealed. This is likened to someone who plants various seeds at the same time but some sprout before others. The second explanation is that existence is attributed to some things before others in order to show their priority in essence and cause (i.e. the sequence is not meant chronologically).

והנה המשילו החכמים הגלות ההויה בקצת הדברים קודם קצת במעשה בראשית למי
  שזרע זרעים חלוקים יחד בארץ ויצמחו קצתם קודם קצת וכן אמרו שהיה הענין
  בהוית העולם שהכל נתהוה יחד מהשם יתע' ונגלה קצתו קודם קצת או נאמר שכבר
  נתיחסה ההויה לקצת הדברים קודם קצת להעיר על היותם קודמים בעצם ובסבה כי
  כונת התורה היא להעמידנו על חכמת הנמצאות בזה הספור הבפלא כמו שקדם

(See also his similar discussion in Wars of the Lord ('מלחמות ה) Book VI Part 2 Chapter 8.)
R. Abraham of Vitirbo (Sefer Emunas Chachamim Fifth Essay)applies the general rule of "ein mukdam u'meuchar b'torah" to the account of creation, in which case the sequence of six days does not necessarily represent the true chronological sequence.

ויש מן הפילוסופים שהקשו כי היאך נתהוה האור ביום הראשון והלא עדין לא
  נבראו המאורות ולאו קושיא היא כי אין מוקדם ומאוחר בתורה

